Firefox is throwing a javascript error: "simplemenu is not defined" with a reference to the following line.
var menu = $(simplemenu).attr("id", "simplemenu").addClass('clear-block');
The javascript error is creating problems with the IMCE module. I could not find a patch for this bug. Has anyone else experienced this problem?
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | simplemenu.module.patch | 566 bytes | davidwhthomas |
Comments
Comment #1
easp commentedThe same problem exists with the dev version.
Comment #2
michaelj commentedHi, in file simplemenu.js try add
+ if (typeof(simplemenu) != "undefined") {
var menu = $(simplemenu).attr("id", "simplemenu").addClass('clear-block');
+ }
Comment #3
easp commentedI tried the fix above. I receive a different javascript error now which still breaks my module. Error is:
Error: [Exception... "Node cannot be inserted at the specified point in the hierarchy" code: "3" nsresult: "0x80530003 (NS_ERROR_DOM_HIERARCHY_REQUEST_ERR)" location: "http://wwwdev.nebrwesleyan.edu/misc/jquery.js?7 Line: 13"]
It appears the fix broke something in jquery.js
Here is the patch I added to simplemenu.js
if (typeof(simplemenu) != "undefined") {
var menu = $(simplemenu).attr("id", "simplemenu").addClass('clear-block');
}
Comment #4
jrust commentedI was having this problem because I had defined some pages not to show the simplemenu under simplemenu's advanced settings.
On those pages where it was not supposed to be showing it was throwing the $(simplemenu) not defined error. Putting this at line 11 fixed it for me:
if (typeof(simplemenu) == "undefined") {
return;
}
Comment #5
davidwhthomas commentedI too had this error.
I debugged and found the problem is that simplemenu_init is adding all the javascript on pages where simplemenu is not actually enabled. Because there is no target html element, the js error is thrown.
The attached patch fixes this by checking simplemenu_enabled() before adding the javascript in simplemenu_init
DT
Comment #6
davidwhthomas commentedComment #7
jaypanThat patch solved the problem for me. Thanks mate.
Comment #8
davidwhthomas commentedPerhaps the patch in #5 could be committed to cvs?
Comment #9
orizu commentedHaving traced the issues with IMCE to simplemenu_init, this worked for me and is now in play across 3 of my sites. +1 for commit
Comment #10
mikerjohnson commentedComment #4 worked for me. Neither #2 nor #5 resolved the errors I was seeing. Issue was that IMCE was not functional when used from within the rich editor, but did work properly from the "file browser" link from a user's profile.
Comment #11
AlexisWilke commentedThe patch in #5 is part of 1.4.
Thank you.
Alexis Wilke