Frequently I get Drupal.settings.admin_menu is undefined JavaScript error. This is blocking other jQuery code like drop-down menus, image hover, etc.

I got this only in Firefox 3. Cannot reproduce in IE6 or in Chrome...

I'm using:

  • Drupal 6.6
  • Drupal Administration Menu 6.x-1.1
CommentFileSizeAuthor
#8 FireShot capture #89.png298.49 KBpyg77

Comments

sun’s picture

Status: Active » Postponed (maintainer needs more info)

Please check your theme. DAM is heavily tested on Firefox 2 and 3.

My only guess is that your theme loads JavaScript files, but does not add Drupal.settings inline JavaScript to the page.

Also, please try whether clearing your browser's cache as well as restarting the browser helps. Firefox has some ugly caching bugs related to JavaScript sometimes.

claudiu.cristea’s picture

I have this in the page source:

    <script type="text/javascript" src="/files/js/ce3a22e9ec1d4c48133a4b52a3a93c4b.js"></script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
jQuery.extend(Drupal.settings, { "basePath": "/", "admin_menu": { "margin_top": 1 }, "thickbox": { "close": "Close", "next": "Next \x3e", "prev": "\x3c Prev", "esc_key": "or Esc Key", "next_close": "Next / Close on last", "image_count": "Image !current of !total" } });
//--><!]]>
</script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
    // initialize tooltips in a separate thread
    $(document).ready(function() {
      window.setTimeout(hovertipInit, 1);
    });

//--><!]]>
</script>

It seems that Drupal.settings line is there.

sun’s picture

Sorry, I cannot think of another cause. If both the JavaScript and Drupal.settings are actually there, something else seems to hi-jack your JavaScripts. Try disabling other contrib modules to see who's guilty.

sun’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Without further information, I'm obliged to mark this issue won't fix.

pyg77’s picture

Title: "Drupal.settings.admin_menu is undefined" JS error » "Drupal.settings.admin_menu is undefined" JS error (Theme developper incompatibility)
Status: Closed (won't fix) » Active

Sorry to reopen but I've had exactly the same issue.

To reproduce :

Brand new Drupal 6.6
* menu_admin enabled : everything is fine
* Developper module enabled : everything is fine
* Theme developer 6.x-1.12 sub-menu enabled : when I click on any small arrow to dropdown (i.e) "Publishing options" on a node, the page scroll back to top and the dropdown doesn't dropdown

It seems that admin-menu is not compatible with latest theme developper submodule (?)

sun’s picture

Title: "Drupal.settings.admin_menu is undefined" JS error (Theme developper incompatibility) » devel_themer breaks admin_menu
Component: CSS / Browser Support » Code

Better title.

sun’s picture

Could you please test whether devel_themer still breaks admin menu when using the latest development snapshot of admin menu?

pyg77’s picture

StatusFileSize
new298.49 KB

I tried with the devel version of admin_menu released today, same error :

doc.body is null
e()jquery.js?l (line 13)

[Break on this error] eval(function(p,a,c,k,e,r){e=function(c){return(c

If I disable devel_themer, all is fine...

I'm surprised that no other people had the same bug, admin_menu and devel_themer are very usefull for each drupal install...

Did somebody experienced the same issue?

sun’s picture

Status: Active » Closed (won't fix)

well, after disabling admin_menu (this was probably the first time I disabled it) and keeping devel_themer enabled, I'm still getting the very same error when trying to open collapsed fieldsets. So this bug is not caused by admin menu at all. Hence, marking won't fix.