Ticket #6112 (closed defect: worksforme)

Opened 9 months ago

Last modified 8 months ago

Javascript error and TinyMCE does not appear

Reported by: neoen Assigned to: azaozz
Priority: high Milestone:
Component: TinyMCE Version: 2.5
Severity: normal Keywords: has-patch
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

Javascript_error.PNG (17.0 kB) - added by neoen on 03/06/08 13:41:42.
onload-fix.patch (1.3 kB) - added by azaozz on 03/08/08 21:35:34.
phpinfo().mht (65.4 kB) - added by neoen on 03/11/08 10:17:20.
phpinfo().zip (14.3 kB) - added by neoen on 03/11/08 10:18:22.
phpinfo(2).zip (14.4 kB) - added by neoen on 03/11/08 11:39:54.

Change History

03/06/08 13:41:42 changed by neoen

  • attachment Javascript_error.PNG added.

03/06/08 16:27:45 changed by lloydbudd

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.

03/06/08 17:37:31 changed by azaozz

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.

03/06/08 23:37:04 changed by DD32

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.

03/06/08 23:43:35 changed by DD32

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.

03/07/08 00:02:07 changed by DD32

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.

03/07/08 19:59:00 changed by azaozz

  • 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.

03/08/08 20:05:20 changed by azaozz

  • keywords set to has-patch.

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.

03/08/08 21:35:34 changed by azaozz

  • attachment onload-fix.patch added.

03/10/08 00:12:48 changed by DD32

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

03/11/08 00:58:37 changed by matt

  • status changed from assigned to closed.
  • resolution set to fixed.

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

(follow-up: ↓ 11 ) 03/11/08 10:16:36 changed by neoen

  • status changed from closed to reopened.
  • resolution deleted.

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.

03/11/08 10:17:20 changed by neoen

  • attachment phpinfo().mht added.

03/11/08 10:18:22 changed by neoen

  • attachment phpinfo().zip added.

(in reply to: ↑ 10 ) 03/11/08 10:45:33 changed by azaozz

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.

(follow-up: ↓ 13 ) 03/11/08 11:39:13 changed by neoen

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...

03/11/08 11:39:54 changed by neoen

  • attachment phpinfo(2).zip added.

(in reply to: ↑ 12 ) 03/13/08 20:00:38 changed by azaozz

  • status changed from reopened to closed.
  • resolution set to fixed.
  • milestone deleted.

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.

(follow-up: ↓ 17 ) 03/13/08 20:10:26 changed by westi

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

03/13/08 21:10:10 changed by lloydbudd

  • status changed from closed to reopened.
  • resolution deleted.

03/13/08 21:10:16 changed by lloydbudd

  • status changed from reopened to closed.
  • resolution set to worksforme.

(in reply to: ↑ 14 ) 03/14/08 01:09:05 changed by azaozz

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.