diff -u b/includes/common.inc b/includes/common.inc --- b/includes/common.inc +++ b/includes/common.inc @@ -4218,7 +4218,7 @@ if (!variable_get('javascript_always_use_jquery', TRUE)) { $need_jquery = FALSE; foreach ($javascript as $key => $item) { - if ($item['type'] != 'setting' && !isset($item['need_jquery']) || $item['need_jquery']) { + if ($item['type'] != 'setting' && (!isset($item['need_jquery']) || $item['need_jquery'])) { $need_jquery = TRUE; break; } diff -u b/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test --- b/modules/simpletest/tests/common.test +++ b/modules/simpletest/tests/common.test @@ -1344,12 +1344,12 @@ * Test adding a JavaScript file with a different weight. */ function testDifferentWeight() { - drupal_add_js('core/misc/collapse.js', array('weight' => 2)); - drupal_add_js('core/misc/tabledrag.js', array('weight' => 999)); + drupal_add_js('misc/collapse.js', array('weight' => 2)); + drupal_add_js('misc/tabledrag.js', array('weight' => 999)); drupal_add_js_page_defaults(); $javascript = drupal_add_js(); - $this->assertEqual($javascript['core/misc/collapse.js']['weight'], 2.001, t('Adding a JavaScript file with a different weight caches the given weight.')); - $this->assertEqual($javascript['core/misc/tabledrag.js']['weight'], 999.002, t('Adding a JavaScript file with a different weight caches the given weight.')); + $this->assertEqual($javascript['misc/collapse.js']['weight'], 2.001, t('Adding a JavaScript file with a different weight caches the given weight.')); + $this->assertEqual($javascript['misc/tabledrag.js']['weight'], 999.002, t('Adding a JavaScript file with a different weight caches the given weight.')); } /**