WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#6112 closed defect (bug) (worksforme)

Javascript error and TinyMCE does not appear

Reported by: neoen Owned by: azaozz
Milestone: Priority: high
Severity: normal Version: 2.5
Component: TinyMCE Keywords: has-patch
Focuses: Cc:

Description

When I try to edit or publish new post, no chance to TinyMCE editor appear. I can not change HTML and Editor during editing.

In IE7 there is Javascript error (see attached screenshot).
In Firefox there is no error message, but it does not work for me too.
I have latest version from trunk.

Thank you for your help.

Attachments (5)

Javascript_error.PNG (17.0 KB) - added by neoen 6 years ago.
onload-fix.patch (1.3 KB) - added by azaozz 6 years ago.
phpinfo().mht (65.4 KB) - added by neoen 6 years ago.
phpinfo().zip (14.3 KB) - added by neoen 6 years ago.
phpinfo(2).zip (14.4 KB) - added by neoen 6 years ago.

Download all attachments as: .zip

Change History (22)

neoen6 years ago

comment:1 lloydbudd6 years ago

neoen, in the future be sure to put the error right in your bug report:

Line: 66
Char: 9
Error: 'tinyMCE' is undefined
Code: 0
URL: http://localhost/WordPress/wp-admin/post.php?action=edit&post=14

Also, please include the trunk svn revision.

Where you running an older version there before? Have you cleared the browser cache for both browsers?

If that isn't the problem, as it generally works for people in both IE7 and Fx 2, we will need more details about the web server environment.

comment:2 azaozz6 years ago

It seems there was another js error in IE, clicking on the "Previous" button on the error message would show it.

Most general errors like this are caused by cache, can you try emptying both browsers cache. Also if you have Firebug in Firefox, look on the "Net" tab for any files that have failed loading (red 404s) and also check if the compressed tiny_mce_config is loaded, should show as 64-65KB js file.

comment:3 DD326 years ago

I came up against this error a few days ago, And still have the same trouble. I asked on #wordpress-dev and someone(cant remember who) confirmed it was working A-OK after a reboot and cache clearing.. Yet i still couldnt get it working.

I cant find any PHP errors, and the exact same install works in Opera9 fine.

comment:4 DD326 years ago

Hm.. Interesting.

I just tried again, It had the drag-holder in the bottom right, so i started dragging it, The TinyMCE toolbars showed up.

Reloaded the page, TinyMCE tolbars not there, and nor is the drag-handle, Clicking a media button results in a JS error, but it still loads the add-media stuff.

I cant get IE to give me any JS errors.. it reverts to Visual Studio, Which cant do dynamic JS debugging.. so i never get a chance to see the errors.

comment:5 DD326 years ago

And a bit more to add, If i save the page as a .html(in /wp-admin/ to prevent access denied messages from IE), and continuously re-load it, it loads fully about 1/5th of the time, the rest of the time it just sits there with <p>blahblahblah</p> from the test post..

Looking at the server logs, All the files are being sent with code 304(Not Modified), so i dont think its a server-change.. but i cant see why its happening.

comment:6 azaozz6 years ago

  • Owner changed from anonymous to azaozz
  • Status changed from new to assigned

Finally was able to reproduce this. Not the original error, but the case reported by DD32.

TinyMCE would load but fail to render in IE7 sometimes, reloading the page may fix it in about 1 in 5 attempts, refreshing the page (while holding Ctrl) fixes it every time.

Seems to be a caching problem only in IE7 that may also be related to some of the other js on the page. Reverting TinyMCE back to version 3.0 (Jan 25) doesn't seem to fix it. Going to try previous nightly builds of WordPress to see when it was introduced.

comment:7 azaozz6 years ago

  • Keywords has-patch added

This is a complex issue involving js timing and caching. Traced it down to the new addLoadEvent() code. However it seems we are loading jQuery on all admin pages, so perhaps we can use jQuery(document).ready instead.

The included patch tries to use jQuery(document).ready and if not present, uses the old addLoadEvent code.

azaozz6 years ago

comment:8 DD326 years ago

attachment onload-fix.patch added.

That seems to have fixed the problems for me in IE7, Its still working after a few reloads (with and without) the cache

comment:9 matt6 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [7226]) Use jQuery load function when available. Fixes #6112; Hat tip: azaozz.

comment:10 follow-up: neoen6 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Revision 7236.
I were running here also older versions (from trunk).
Now error in IE7 changed to:

Line: 2
Char: 1
Error: Invalid character
Code: 0
URL: http://localhost/WordPress/wp-admin/post.php?action=edit&post=14

I cleared browser cache (if you mean this: http://kb.iu.edu/data/ahic.html) and no change.

When I try to edit or publish new post, no chance to TinyMCE editor appear. I can not change HTML and Editor during editing. In IE7 there is Javascript error. In Firefox there is no error message, but it does not work for me too.

I will add my phpinfo to this ticket.

neoen6 years ago

neoen6 years ago

comment:11 in reply to: ↑ 10 azaozz6 years ago

Replying to neoen:

Revision 7236.
I were running here also older versions (from trunk).
Now error in IE7 changed to:

Line: 2
Char: 1
Error: Invalid character
Code: 0
URL: http://localhost/WordPress/wp-admin/post.php?action=edit&post=14

I cleared browser cache (if you mean this: http://kb.iu.edu/data/ahic.html) and no change.

When I try to edit or publish new post, no chance to TinyMCE editor appear. I can not change HTML and Editor during editing. In IE7 there is Javascript error. In Firefox there is no error message, but it does not work for me too.

I will add my phpinfo to this ticket.

Try to disable zlib or turn off compression in tiny_mce_config.php, line 143, change it to

'compress' => false, 

and see if that helps.

comment:12 follow-up: neoen6 years ago

Turning off compression in tiny_mce_config.php does not help.

But when I set

zlib.output_compression = Off

then it works very well for me in IE7!
But I think that many webhosters allows this possibility...

Then also works zlib.output_compression = On for me. So I am not sure where exactly the problem is.

Also in Firefox. I disabled zlib, then clear cache, it works, then enable zlib, clear cache and it works now (everytime restarted Apache of course)... I will add my current phpinfo.

But it works now and thank you for your help...

neoen6 years ago

comment:13 in reply to: ↑ 12 azaozz6 years ago

  • Milestone 2.5 deleted
  • Resolution set to fixed
  • Status changed from reopened to closed

Replying to neoen:

...
But I think that many webhosters allows this possibility...

Then also works zlib.output_compression = On for me. So I am not sure where exactly the problem is.
...
But it works now and thank you for your help...

TinyMCE's compressor uses gzencode() which is incompatible with zlib.output_compression. It checks that zlib.output_compression is turned off before compressing the js, and in your phpinfo it shows as off, but perhaps it is set to On in your php.ini and then turned off later, which doesn't work.

You're right that most web hosts support zlib.output_compression, but it's set to Off by default. If it's enabled, the compressor won't compress the js, only concatenate it into one file.

comment:14 follow-up: westi6 years ago

double compression could be caused by mod_deflate as well as zlib.output_compression

comment:15 lloydbudd6 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:16 lloydbudd6 years ago

  • Resolution set to worksforme
  • Status changed from reopened to closed

comment:17 in reply to: ↑ 14 azaozz6 years ago

Replying to westi:

double compression could be caused by mod_deflate as well as zlib.output_compression

Apache seems clever enough not to double compress gzipped content. It runs deflate after php has finished and checks the header.

Note: See TracTickets for help on using tickets.