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.
My module needs to also preprocess the JS attributes and run AFTER jQuery Update, but when it does it wipes out jQuery Update's replacements. I have added this ONE line code in the jquery_update.module, line 83:
function jquery_update_preprocess_page(&$variables) {
-------- CODE -----------
+ $variables['js'] = $scripts;
$variables['scripts'] = drupal_get_js('header', $scripts);
}
}
}
By assigning: $variables['js'] = $scripts; This allows me to use the JS array you modified. For those who do not have jQuery Update installed, I use this code to load the Drupal's JS array if $variables['js'] doesn't exist.
if (!isset($variables['js'])) {
$variables['js'] = drupal_add_js();
}
$javascript = $variables['js'];
Comments
Comment #1
markhalliwellThe module I am referring to is Browser Theme Settings.
Comment #2
markhalliwellMarking as a duplicate of #426764: Allow other modules to alter the replacements
Comment #3
klonossubscribing...
Comment #4
kenorb CreditAttribution: kenorb commented#965680: jquery_update_preprocess_page() overwrite $variables['scripts']
#426764: Allow other modules to alter the replacements