• Tried searching for solutions to this, but no avail.

    Basically, In a production environment, the TinyMCE editor doesn’t load. No ‘visual’ or ‘text’ tabs at the top, and no JavaScript errors thrown. Cloning the server, and testing when removed from the CDN (CloudFront) and loadbalancer works fine.

    Here’s what I’ve noticed so far in trying to debug:

    On the test server if I watch the tinyMCEPreInit object and inspect it’s contents, the base parameter is set correctly as : “http://<domain>/wp-includes/js/tinymce&#8221;

    Doing the same in production, the base parameter is empty.

    I then tried forcing the URL through the includes_url filter since the base parameter is set by $baseurl = includes_url(‘js/tinymce’); in /wp-includes/class-wp-editor.php with:

    $callback = function($url, $path) {
        $url = get_bloginfo('url').'/'. WPINC . '/';
    
        if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
            $url .= ltrim($path, '/');
    
        return $url;
    };
    
    add_filter('includes_url', $callback, 10, 2);

    In the test environment, I can force the base URL to whatever I wish. In prod this still remains empty. I’m at a loss. Even tried upgrading to 3.7, with no luck. Thoughts?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter fahdoos

    (@fahdoos)

    Possibly unrelated, but I noticed recently that some links within wp-admin use the server host instead of the website URL, for example the post list pagination links at /wp-admin/edit.php. Digging through the code this is due to some of the links using $_SERVER[‘HTTP_HOST’]. I forced this to the correct value via wp-config.php as a long shot. While it fixes some of the broken links in wp-admin, didn’t help with the TinyMCE issue.

    Also, I should point out that I am using a reverse proxy, which probably has something to do with HTTP_HOST not resolving properly.

    Any suggestions?

    Thread Starter fahdoos

    (@fahdoos)

    Bump!

    Any ideas? Still broken after upgrading to 3.9.1

    Additional question: between headers and cookies what needs to reach the server for tinymce to load properly? Specifically what paths/files do they apply to? Note: login and all other functionality works fine. Only the visual editor is broken.

    right now I have the following paths forwarding all cookies, but no headers:

    wp-includes*
      wp-admin*
      wp-login.php*

    Wondering if there is something in the headers that helps tinymce initialze?!? If so, what files/paths need to get those headers passed through?

    Thread Starter fahdoos

    (@fahdoos)

    FYI, I was able to get the visual editor working by passing in ALL headers, but would be great to know which ones are required to limit this down. Anyone know?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘tinyMCEPreInit broken – maybe CDN related’ is closed to new replies.