• Resolved kylmorg

    (@kylmorg)


    So I’ve been having an issue with my back-end that doesn’t allow me to switch from Visual to Text layout when adding a new post. I’ve thoroughly researched this problem and tried EVERYTHING (disable plugins, change theme, re-upload WP directories and files, etc.)

    I’ve boiled it down to what I think is a JavaScript issue causing this problem. When I open a new post and then run JavaScript Console, the following errors come up:

    View post on imgur.com

    Any suggestions on how I can repair these? Thanks.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The first file-not-found in the console is wp-tinymce.js. This file is not in the WordPress install zip file, which instead has the much smaller wp-tinymce.js.gz. What’s supposed to happen is that the WordPress install script should unpack the gz to make the required file.

    The unpacking is not happening. Best guess, and I’m not confident about this bit, is that your host has mod_security enabled on apache, and this disables gz unpacking. See the post about GZIP on this page.

    So two possible solutions suggest themselves. Either contact your host tech support about the problem, ask if they have mod_security enabled, ask is this likely to disable gz unpacking, and if so can they disable mod_security for your account so that WordPress will install correctly. Then reinstall WordPress from Admin page > Dashboard > Updates.

    Or, download wordpress-4.0.zip to your hard drive, find wp-tinymce.js.gz, unpack it on your hard drive, upload wp-tinymce.js to the path given in the console error. This should resolve the first file-not-found error. Repeat this procedure for the other file-not-found errors. Repeat the whole thing every time WordPress is updated.

    Thread Starter kylmorg

    (@kylmorg)

    Okay so your first solution isn’t the issue. I’ve switched hosts recently and the problem was present on the old and new hosts. Now I’ve got the problem down to 1 issue and I’ve seen it on a ton of google searches.

    There’s an issue with jquery in that tinymce is not defined. It reads as such:

    ncaught ReferenceError: tinyMCE is not defined

    So far from googling, the best answer I’ve found is the LAST answer on this post:
    http://stackoverflow.com/questions/14352407/jquery-error-tinymce-is-not-defined-on-wordpress-admin-panel

    The only problem for me is I don’t know what I’m supposed to change and where I’m supposed to make $compressed=0. The code mentioned in that article looks like this for me:

    if ( $tmce_on ) {
    			if ( $compressed ) {
    				echo "<script type='text/javascript' src='{$baseurl}/wp-tinymce.php?c=1&$version'></script>\n";
    			} else {
    				echo "<script type='text/javascript' src='{$baseurl}/tiny_mce.js?$version'></script>\n";
    				echo "<script type='text/javascript' src='{$baseurl}/wp-tinymce-schema.js?$version'></script>\n";

    That so-called solution was not for 4.0. You never want to change core files.

    You can use ftp or the file manager provided by your host to upload the wp-includes/js/tinymce folder. Try that (as suggested by @lorro).

    Thread Starter kylmorg

    (@kylmorg)

    Thanks. I’ve uploaded a fresh version of that folder and it still doesn’t work. One of the problems is that the Java console says it’s looking for two specific files in that folder that just don’t exist.

    1. tiny_mce.js
    2. wp-tinymce-schema.js

    If it happened on old and new hosts it could just mean that both hosts had mod_security enabled. I still think its worth adding the question. If mod_security is disabled fixes the issue, it would be a permanent fix.

    But to answer your last question, the file is
    wp-includes/class-wp-editor.php
    and the new line goes in like this:

    if ( $tmce_on ) {
        $compressed = 0;
        if ( $compressed ) {

    at line 1071 if you are using WordPress 4.0. I’m not able to test this fix since gz unpacking works on my host. You will need to redo this edit for each WordPress update.

    My solution 2 was to unpack the .gz on your hard drive to make the missing file, and upload this file, not to upload the folder.

    Thread Starter kylmorg

    (@kylmorg)

    Yes and when I unpack the .gz the only file that is unpacked is wp-tinymce.js

    AFAIK, those files have not been used since WP3.6.

    Securi shows your upgrade went wrong somewhere.

    WordPress version: WordPress 4.0
    Wordpress version from source: 3.6
    Wordpress Version 3.6 based on: http://thatwasjunk.com//wp-admin/js/common.js
    All in One SEO Pack version: 2.2.3.1
    WordPress theme: http://thatwasjunk.com/wp-content/themes/twentytwelve/
    Wordpress internal path: /home/thattesa/public_html/wp-content/themes/twentytwelve/index.php
    WordPress version outdated: Upgrade required.
    Outdated WordPress Found: WordPress Under 4.0

    Thread Starter kylmorg

    (@kylmorg)

    Huh, weird. So how do I go about uploading a fresh version of 4.0?

    I did this just recently based on another help thread I had started. I replaced the wp-admin & wp-includes directories completely and left my wp-content directory alone as I was instructed to. Also didn’t replace the wp-config.php file but replaced all other loose files sitting in my /wp/ directory.

    Thread Starter kylmorg

    (@kylmorg)

    Ha jesus. Just did a re-install and everything’s working now. Had no idea it didn’t correctly upgrade. PROBLEM SOLVED.

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

The topic ‘JavaScript error effecting Visual/Text Editor’ is closed to new replies.