For some reason a bunch of core JS files are not being loaded. I've had to manually add them in with a module hook_js_alter
function like so:
function MYMODULE_js_alter(&$js) {
drupal_add_js('misc/jquery.js', array('group' => JS_LIBRARY, 'weight' => -100, 'every_page' => TRUE, 'scope' => 'header'));
drupal_add_js('misc/jquery.once.js', array('group' => JS_LIBRARY, 'weight' => -99, 'every_page' => TRUE, 'scope' => 'header'));
drupal_add_js('misc/jquery.cookie.js', array('group' => JS_LIBRARY, 'weight' => -98, 'every_page' => TRUE, 'scope' => 'header'));
drupal_add_js('misc/form.js', array('weight' => 19, 'every_page' => TRUE, 'scope' => 'header'));
drupal_add_js('misc/collapse.js', array('weight' => 20, 'every_page' => TRUE, 'scope' => 'header'));
}
The only core JS file loading by itself is drupal.js
, and a bunch of module scripts. Other than that I had to include the 5 above myself, otherwise various parts of the public site and admin areas were not working.
This works, but it feels really sketchy. And previously I had only included the first 3, until I noticed more admin form stuff breaking. So I hate to think that there may be MORE scripts that I will only discover missing through trial and error.
Any ideas why they are not being included??
UPDATE
I've narrowed it down, there are two custom modules which are breaking it. One of them is much simpler than the other so I'll just try to figure that one out first. This line of code, inside the .module file, and not within any function, is causing the issue ($form_js is a string containing JavaScript)
drupal_add_js($form_js, array('type' => 'inline', 'scope' => 'footer'));
progress.js
andbatch.js
were not being included. -_- What is going on?!dpm($js);
on the begining of your implementation ofhook_js_alter()
and see if the files exists in that array.