DOMAIN MAPPING BREAKS DIVI VISUAL EDITOR

This one appears to be the same issue as in this other closed question:
https://premium.wpmudev.org/forums/topic/domain-mapping-breaks-divi-visual-editor#post-1208826

I was asked to start a new ticket instead of appending to the old one, so here goes :slight_smile:.

I'm using
Divi 3.0.31
Domain Mapping 4.4.2.4
WP 4.7.2

1. I have a multi-site setup.
2. I have a wildcard certificate for *.mydomain.com.
3. Each subdomain-based site may have another domain name mapped. For example, customerdomain.com maps to customerdomain.mydomain.com.
4. I have things set to force HTTPS for back-end admin pages. Therefore, I have things set up to not use domain mapping when on the back-end admin pages (so the user would be looking at pages on https://customerdomain.mydomain.com, which is covered by my wildcard cert.
5. When The new Divi Visual Editor button is presented, it links to https://customerdomain.com/?et_fb=1. Clicking that brings them to a browser warning page that says the domain in the certificate (*.mydomain.com) doesn't match the domain in the URL (https://customerdomain.com).

I don't want to switch off https for the back-end admin pages.
I need to use the Divi theme.

In troubleshooting this, I found their et_fb_prepare_ssl_link looks like this:

function et_fb_prepare_ssl_link( $link ) {
        // replace http:// with https:// if FORCE_SSL_ADMIN option enabled
       if ( defined( 'FORCE_SSL_ADMIN' ) && FORCE_SSL_ADMIN ) {
           return str_replace( 'http://', 'https://', $link );
       }
       return $link;
}

If I change it to this, then it almost fixes it:

function et_fb_prepare_ssl_link( $link ) {
           // replace http:// with https:// if FORCE_SSL_ADMIN option enabled
           if ( defined( 'FORCE_SSL_ADMIN' ) && FORCE_SSL_ADMIN ) {
                    $link = str_replace( 'http://', 'https://', $link );
           }
          //This next part checks if it's https and not *.mydomain.com.  If it is, then
         //switch it to the value in  the siteurl option, which is always
         // of the form https://customerdomain.mydomain.com
          if (preg_match("/https\:\/\/(?!.*mydomain\.com)/", $link)) {
                   $link = get_option('siteurl');
          }
         return $link;
}

When I do that, at least it always creates the link to use https://customerdomain.mydomain.com/?et_fb=1 instead of https://customerdomain.com.

However, even with that code patch, for some reason even though hovering over the "Use Visual Builder" the link in the status bar shows https://customer.mydomain.com/?et_fb=1 (desired), after clicking on "Use Visual Builder" somehow it switches back to http://customerdomain.com/?et_fb=1 (which is what I don't want...note now it's not even https anymore).

I suspect this might have something to do with domain mapping switching it back. I hope this extra level of detail helps.

Your advice is much appreciated.

Best,
Dave

  • Nastia
    • Support Rock Star

    Hello David Thibault , I hope yu are doing well!

    I'm sorry to hear that you are experiencing this issue.

    This issue, was reported as a bug and was reported recently to our developers. Right now there is no hotfix available, although our developers working on it.

    Once the hotfix will be out, I will post it in this thread. I will provide your solution to our developers, and hope this will be fixed soon!

    I've sent some points your way :wink:

    Kind regards,
    Nastia

  • kennibc
    • The Crimson Coder

    Any update on this issue? Do you need further details. I am wondering if it is because originally the site was http and now with the domain mapper we are using ssl? Could this be causing an issue with the scripts that Divi uses for frontend editing?

  • Nastia
    • Support Rock Star

    Hello kennibc

    I trust you are doing well!

    Please replace the Mapping.php that is located on the path shown bellow, with the attached file here.
    /wp-content/plugins/domain-mapping/classes/Domainmap/Module/Mapping.php

    This should fix the issue.

    Please let us know how it went!

    Kind regards,
    Nastia

  • David Thibault
    • The Incredible Code Injector

    Nastia,

    Can you let us know if this is part of a released version (and which version) of Domain Mapping or a branch of some sort? I would like to make sure that it's part of the release stream so I know what to do when future updates come out.

    Best,
    Dave

  • Nastia
    • Support Rock Star

    Hello there Dave

    This code is part of the beta Domain Mapping version which should fix this issue. This version is not released yet.

    When the feature update will be out, this file will be overwritten with the files from the official version.

    Let me know how it went!

    Kind regards,
    Nastia

      • Nahid
        • Tech Support

        Hey Sean !
        Hope you are having a great day!

        I'm sorry about the matter that you're experiencing this inconvenience. Unfortunately, the update with this fix hasn't been deployed yet as the developers are going through some more extensive tests. It should be out soon. For now, can you please try the hot-fix suggested by my colleague Nastia in this response?

        Please let us know if this works for you. I'll be looking forward to hearing back from you. Thanks!

        Best,
        Nahid

          • Nastia
            • Support Rock Star

            Hello Sean

            Hope you are doing well.

            I apologise for the delay with this issue. I've retested the plugin and still can replicate this conflict as well. The above solution is already included within the plugin's core files and it is solving the issue with theme's Customizer.

            This issue looks complex, I've pinged our developers again so they could provide some feedback. Please note because our developers working with complex issues, their response time takes more time compared to the usual support staff.

            We appreciate your patience!

            Kind regards,
            Nastia

    • Nahid
      • Tech Support

      Hey zspri !
      Hope you are having a great day!

      Nahid here, following up from our last Live Chat session. Just responding here to state that this issue was addressed in our chat session and resolved in your case using the latest beta version of the Domain Mapping plugin. The beta version is still being tested by our QA team and should be released once completed.

      For future reference, I've attached the beta version of the plugin along with this response.

      Hope this helps. Let us know if you need any further assistance regarding this. Thanks!

      Kind regards,
      Nahid

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.