Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am trying to specify another custom ajax.js file in place of js/misc/ajax.js using hook_js_alter(&$variables) but this fails. Upon inspection of the &$variables array, my target file js/misc/ajax.js does not appear there at all and thus it is not possible to override it using HOOK_js_alter(&$variables)
Comment | File | Size | Author |
---|---|---|---|
#3 | 2016-07-13 20_30_31-Products.png | 84.38 KB | W.M. |
Comments
Comment #2
markhalliwellhook_js_alter(&$javascript)
, not $variables... granted it doesn't really matter what you decide to name your arguments, but still... it makes it confusing to go against existing DOCs.Comment #3
W.M. CreditAttribution: W.M. commentedAs you can see in the attached image, Bootstrap base theme's
js/misc/ajax.js
cannot be found inside the$javascript
array ofhook_js_alter(&$javascript)
, however it is loaded on the page as can be seen inside HTML source.