Firebug: 1 Error - "effects is undefined"
mikeytown2 - January 24, 2009 - 10:35
| Project: | DHTML Menu |
| Version: | 6.x-3.4 |
| Component: | Javascript code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Jump to:
Description
effects is undefined
dhtmlMenu()()f8ad1e6c....jsmin.js (line 21)
t()()f8ad1e6c....jsmin.js (line 2)
e()f8ad1e6c....jsmin.js (line 2)
t()(Document EDITING_A_VIEW)f8ad1e6c....jsmin.js (line 2)
placeholder()()f8ad1e6c....jsmin.js (line 15)
e()f8ad1e6c....jsmin.js (line 2)
e()f8ad1e6c....jsmin.js (line 2)
e()f8ad1e6c....jsmin.js (line 2)
e()f8ad1e6c....jsmin.js (line 2)
[Break on this error] var effects=Drupal.settings.dhtmlMenu;$(...d')){Drupal.dhtmlMenu.toggleMenu(li);}}}All JS stops working on the page. Get the error randomly, a page refresh usually takes care of it.

#1
yes same error on firebug
it's here with get cookie
I am working in a localhost server, it's perhaps the problem ?
// Get cookieif (!effects.siblings) {
var cookie = Drupal.dhtmlMenu.cookieGet();
for (var i in cookie) {
// If the cookie was not applied to the HTML code yet, do so now.
var li = $('#dhtml_menu-' + cookie[i]).parents('li:first');
if ($(li).hasClass('collapsed')) {
Drupal.dhtmlMenu.toggleMenu(li);
}
#2
after a little research, i think the problem is here
http://drupal.org/node/364801
for customising my principal menu, i use a phptemplate_menu_item override in my tempate.php to give an unique id to my menu.
it seems that the problem is there because on garland it's ok. The problem is only in my theme.
it's a great module but i don't understand why it breaks because my li receive an unique id ?
#3
resolved for me
my solution is not create an id for each li from a menu but add a class and it works.
#4
mikeytown2: You appear to be using aggregated/minified JS code, which makes it tricky to see the problem. The error "effects is undefined" shouldn't occur on that line as effects is being defined by that command. Could you please try this with non-packed Javascript code to make the error clearer? :)
pixelpreview: On that line, the error makes more sense and may mean that Drupal.settings.dhtmlMenu never got set.
Could you please view the HTML code of any page of your site and look for something that looks like this in the header?
jQuery.extend(Drupal.settings, { "basePath": "/", "dhtmlMenu": { "slide": "slide", "siblings": "siblings", "clone": "clone", "relativity": 0, "children": 0, "doubleclick": 0, "iconclick": 0 } });All these fields should be there, even if they're set to 0.
#5
yes I have this line :
jQuery.extend(Drupal.settings, { "basePath": "/lalati6/", "admin_menu": { "margin_top": 1 }, "dhtmlMenu": { "slide": "slide", "siblings": "siblings", "relativity": "relativity", "children": "children", "clone": "clone", "doubleclick": 0 }it's ok for me now.
after changing id in class for my menu in my override function. I don't have errors in firebug after that change.
it works very nice.
thanks for your reply :-)
#6
Confirming this bug.
#4: I looked into that. It seems the error is only present with the Core Javascript Aggregation enabled. I disabled and deinstalled Javascript Aggregator to check if the JSMin minification was causing the error. It does not.
I dont know if this helps more
effects is undefineddhtmlMenu()()js_e86b9...a85fb5.js (Linie 528)
(?)()()js_e86b9...a85fb5.js (Linie 54)
(?)()(Object, function(), undefined)3DYR8yd%...e3Q%3D%3D (Linie 1)
attachBehaviors()(Document menutrails)js_e86b9...a85fb5.js (Linie 53)
(?)()()js_e86b9...a85fb5.js (Linie 288)
(?)()()3DYR8yd%...e3Q%3D%3D (Linie 1)
(?)()()3DYR8yd%...e3Q%3D%3D (Linie 1)
(?)()(function () { return a.call(this, D); }, function(), undefined)3DYR8yd%...e3Q%3D%3D (Linie 1)
(?)()()3DYR8yd%...e3Q%3D%3D (Linie 1)
[Break on this error] if (!effects.siblings) {
this error is located here
Drupal.behaviors.dhtmlMenu = function() {
[...]
// Get cookie
if (!effects.siblings) { <<<<<<<<<<<<< THIS IS WHERE FIREBUG POINTS AT
var cookie = Drupal.dhtmlMenu.cookieGet();
for (var i in cookie) {
// If the cookie was not applied to the HTML code yet, do so now.
var li = $('#dhtml_menu-' + cookie[i]).parents('li:first');
if ($(li).hasClass('collapsed')) {
Drupal.dhtmlMenu.toggleMenu(li);
}
}
}
#7