Posted by posco on March 14, 2008 at 10:29pm
Jump to:
| Project: | TinyMCE |
| Version: | 5.x-1.9 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (duplicate) |
Issue Summary
Hello,
We are using the TinyMCE module with TinyMCE 3.0.5 with Drupal 5.7. When we click the "disable rich-text" link under textareas we receive the following error message in Firebug:
tinyMCE.getEditorId is not a function
mceToggle("edit-code", "wysiwyg4code")
[Break on this error] if (tinyMCE.getEditorId(element.id) == null) {I'm not sure if this is a bug with the TinyMCE module or with TinyMCE.
Comments
#1
This seems to be a tinyMCE api change between versions 2 and 3.
I fixed this by adding some lines to the top of the mceToggle javascript function (line 139 in tinymce.module) to simulate the old api:
// paste this just below the line: function mceToggle(id, linkid) {
if(typeof(tinyMCE.getEditorId) != "function") {
tinyMCE.getEditorId = tinyMCE.get;
tinyMCE.removeMCEControl = function(){
tinyMCE.get(id).remove();
}
tinyMCE.addMCEControl = function(){
tinyMCE.execCommand('mceAddControl', false, id);
}
}
#2
Thanks. That worked for me.
#3
Thanks a lot
#4
I don't think this is an issue between TinyMCE 2 and TinyMCE 3. I had the problem with version 3, so reverted to TinyMCE 2.1.3 (and uninstalled the Drupal module and reinstalled and reconfigured). Same problem.
Drupal: 5.7
Drupal TinyMCE Module: 5.x-1.9
Tinymce: 2.1.3
#5
i'm not sure which file needed this change. is the the module files?
#6
erifneerg, you change the tinymce.module file located in /modules/tinymce
Also I just wanted to say thanks for this. It works like a charm!
#7
thanks much, it works for me
#8
Solution in #1 works for us.
#9
Thanks, your solution ( #1 ) works for me too..
#10
(accidental posting--sorry)
#11
Disable rich text didn't work for me either, not with tinymce 3.x or 2.1. After pasting the code, it worked for me. This would be a great patch! A lot of drupal newbies depend 100% on Tinymce. tinyMCE's difficulty in configuration and various bugs are Drupal's biggest problems for newcomers.
#12
thanks a lot! i've been searching for the solution to this problem for some time now, and this works perfectly!
#13
Thanks, it works. A patch will be appreciated.
Applying http://drupal.org/node/235972#comment-882611 patch, with Webform module enabled I got a strange behavior on "node/add/webform". One button works, the other works only to enable editor, but this action is performed on the other textarea. I got:
Error: tinyMCE.get(id) has no properties
Line: 63
#14
wait a sec, it only works for the first En/disable rich text toggle on a page.
The next ones you click won't work.......
any fix?
#15
still doesn't work....
#16
changed issue status
#17
I'm not sure, but it seems that this is a duplicate of http://drupal.org/node/235972
#18
#1 worked nicely for me with tinymce.module 5.x-1.9, Drupal 5.7 (with default jQuery which I think is 1.1.2) and TinyMCE 3.1.0.1.
There is actually not a proper patch file attached to this issue so resetting Status.
#19
I created a patch and added it to http://drupal.org/node/269527.
#20
fix in #1 worked for me also, thanks so much!!
#21
When I've applied patch #1, I've followed javascript errors:
tinyMCE.addI18n is not a function[Break on this error] more_colors:"Wi\u0119cej kolor\u00F3w"
pl.js (line 61)
tinyMCE.addI18n is not a function
[Break on this error] desc:"Wstaw lini\u0119."
pl.js (line 153)
r is null
Maybe that's, because I have different language set than English.
So it doesn't work for me.
Tested on TinyMCE 3.2 + TinyMCE 6.x-dev
#22
Ad #31
Sorry, the first error lines was related to different issue: http://drupal.org/node/324099
But the patch still doesn't work.
I've tried this one: http://drupal.org/node/235972#comment-882611
But doesn't work as well, but maybe will work for somebody.
#23
richardjg
Thank you very much
#24
Wow, thanks. This worked in Drupal 5.16
I manually added the lines as described in #1, refreshed my page, and the enable/disable links toggle perfectly.
#25
As the project page http://drupal.org/project/tinymce says, most users should probably be using the http://drupal.org/project/wysiwyg module since this one is not maintained any more.
Though I'm still running the now rather antiquated setup of #18 on a couple of sites that I've not yet upgraded/migrated.
#26
Thanks richardjg,
it worked for me
Michel