Closed (duplicate)
Project:
TinyMCE
Version:
5.x-1.9
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 May 2008 at 23:56 UTC
Updated:
11 Jul 2008 at 07:25 UTC
When I have TinyMCE enabled, some pages won't load. The link "enable rich text" appears in the top left of the page, the rest of the page is white, and the loading icon just spins.
It seems to be just these pages affected (the first 2 obviously worked the first time):
/admin/settings/tinymce/edit/(profilename)
/admin/settings/tinymce/add
/admin/user/settings
Most other non-core modules are turned off.
I've done both patches here http://drupal.org/node/244066.
I'm using:
Drupal 6.2
Mac OSX
Firefox 2
I did get this warning in IE6/Win:
Invalid argument supplied for foreach() in .../includes/form.inc on line 1181
Comments
Comment #1
raspberryman commentedI was able to reproduce this with a webform node's edit page.
Comment #2
greenskunkI have the same problem. When you attempt to create content or edit content the templated page appears for a second and then the javascript error occurs and the page goes blank and a link with the words 'Enable rich-text' appears.
This is directly related to applying the patches mentioned by Zelavi.
Firebug says:
I am on Drupal 6.2
TinyMCE Module 6.x-1.1-dev with patches from http://drupal.org/node/244066
Comment #3
raspberryman commentedReproduced with FF2 on Windows XP.
Comment #4
hansl commentedI can confirm this, and after some investigation I've found what appears to be the reason. The patch to enable the "disable rich text"/"enable rich text" links adds a JavaScript snippet after the textarea in question, and the last "document.write()" somehow causes the browser to behave as described, when tiny_mce is activated for the "log message" textarea under "Revision information" (and possibly other areas where it shouldn't be enabled).
I don't have time to investigate this in detail, but it seems the supported way of controlling which textareas are supposed to be affected is the one described in the next to last section of the README.TXT included with the tinymce module.
I copied the innards of the theme_tinymce_theme() function into an equivalent function in the template.php file in my active theme, in this case called phptemplate_tinymce_theme(), and already containing some other code.
With this in place, tiny_mce appears only where it's supposed to, and the patch for the "disable rich text"/"enable rich text" link works.
Hope this helps,
Hans
Comment #5
greenskunkI still can't get this to work with the patch applied.
Firebug says:
Comment #6
hansl commentedGreenSkunk, try finding the definition for $wysiwyg_link in tinymce.module, and go to the next to last line of that block - it starts with
document.write("<div><a href=\"javascript:mceToggle
Place a comment mark (double slash: "//") in front of that, and don't change anything else. Does the page load now? If so, look at the source and try to find out if there are more than one occurrence of that code - you can search for "mceToggle" and look for calls to that function.
If you have more than one occurrence of this code, you have encountered the same problem as I did.
You'll have to make sure there are no tiny_mce textareas on the page except the legitimate ones, which is probably just the body text itself.
Oh, and don't forget to remove the comment mark afterwards.
Comment #7
greenskunkThanks for the reply Hansl.
There are no other TinyMCE areas on the page. After commenting out the mceToggle, the page does load but the textarea is not converted to a TinyMCE editor.
I wonder if my problem is related to a javascript library collision. I'm going to comment out some other javascript and see what happens.
Comment #8
dkalbfle commentedI was having this problem with Drupal 6.2 with tinymce-6.x-1.1-dev
There is some code in tinymce.module, in the theme_tinymce_theme() function, that is causing this problem. The switch statement inspects $textarea_name to determine whether the given textarea should get the tinyMCE editor. The problem is that $textarea_name contains textarea names that contain hyphens, but it is being compared against values with underscores.
i.e. 'access-pages' is being compared with 'access_pages', the comparison fails, and the page goes into some kind of loop and never returns HTML to my browser (that's what happens on my machine, anyway)
To work around this problem, change the switch statement from:
switch ($textarea_name) {to
switch (str_replace('-','_',$textarea_name)) {I'll leave it to the module developer to come up with a more graceful patch :)
Dave.
Comment #9
armyofda12mnkeys commentedhmmm had this same issue with 5.x-1.9
tried the above workaround and it didnt work. any ideas?
i started noticing it in the administration Edit users pages, but then started seeing in on other pages i thought werent affected like node/1/edit.
very funky cause i didnt change anything and i thought it was working on node pages (i did have it working).
using tinymce js version 2.1.3 and i just see the enable rich text in top left corner and nothing on the page and page keeps trying to load.
Firebug reports this error:
$ is not defined
http://drupaltest/misc/textarea.js
Line 4 $('textarea.resizable:not(.processed)').each(function() {
Comment #10
armyofda12mnkeys commentedthis thread i think put a solution that works:
http://drupal.org/node/235972
here is their patch:
Comment #11
chirale commentedhttp://drupal.org/node/235972