Hi Drupal Maintainers,

There seems to be a javascript error in the toolbar.module, within toolbar.js, that breaks jquery running on site, pulled in via drupal_add_js(). This is a fresh install of 7.34. I am using a Zen subtheme.

Issue in summary: when the toolbar.module is enabled, the chromebug console identifies a single error:

"Uncaught TypeError: undefined is not a function." It points to toolbar.js, line 12. This code is as follows:

Drupal.toolbar = Drupal.toolbar || {};

/**
 * Attach toggling behavior and notify the overlay of the toolbar.
 */
Drupal.behaviors.toolbar = {
  attach: function(context) {

    // Set the initial state of the toolbar.
    $('#toolbar', context).once('toolbar', Drupal.toolbar.init); /****This is the malfunctioning line, according to Chromebug*****/

    // Toggling toolbar drawer.
    $('#toolbar a.toggle', context).once('toolbar-toggle').click(function(e) {
      Drupal.toolbar.toggle();
      // Allow resize event handlers to recalculate sizes/positions.
      $(window).triggerHandler('resize');
      return false;
    });
  }
};

I'm not sure what part of this code is not functioning, but when the toolbar.module is enabled, most jquery on the page ceases to function, sliders, other widgets, etc. As the toolbar only shows up for administrators, this problem is limited to logged in administrators, and anonymous users do not experience this problem. Disabling the module fixes the problem. Re-enabling the module recreates the problem. Uninstalling and reinstalling the module does nothing.

Browsers I have tested this in: Chrome - problem exists as described. Firefox - problem exists as described. Safari - problem exists as described.

Other approaches I've taken to fix this issue: install and enable jQuery update, in hopes that a different version of jQuery would not handle this code as an error. This has not fixed the problem. Neither has clearing cache, or clearing the theme registry.

Searches I've performed to see if this issue has been identified and solved beforehand: numerous, but nothing comes up exactly as to toolbar.js. A few views AJAX issues and IMCE issues came up, but nothing specifically relating to toolbar.module or toolbar.js

Please let me know if you would like any further testing performed. Am happy to grant access to the development site for further analysis.

Thanks for your hard work.

TC

Comments

tripodcreative’s picture

Issue summary: View changes
David_Rothstein’s picture

Status: Active » Postponed (maintainer needs more info)

I tried a fresh installation of Drupal 7 using Firefox and don't see this JavaScript error.

Do you have any more details - what do you mean by saying that jQuery is "pulled in via drupal_add_js()"... what code are you running specifically that does this?

Version: 7.34 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.