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.
The AdvAgg module does it's own rendering of scripts and due to the way drupal_alter works themes run last so there is no way to fix this with hook weights. I currently check the element_info and if it the #aggregate_callback is not _advagg_aggregate_js then I rerun the advagg_element_info_alter function.
It would be nice if omega checked to see if $elements['scripts'] is already populated before overwriting it.
Comment | File | Size | Author |
---|---|---|---|
#7 | omega-2492461-7.patch | 884 bytes | klausi |
#1 | omega-2492461-1-smarter-element-info-alter.patch | 861 bytes | mikeytown2 |
Comments
Comment #1
mikeytown2 CreditAttribution: mikeytown2 commentedComment #2
joelpittetIs there any case where omega info alter would happen before advagg's?
Comment #3
mikeytown2 CreditAttribution: mikeytown2 commentedIt will always run after all modules have ran. #865536: drupal_add_js() is missing the 'browsers' option is where the omega code comes from most likely.
Comment #4
joelpittetOk cool, this seems to do the trick. Thanks again @mikeytown2
Comment #5
dolphinonmobile CreditAttribution: dolphinonmobile as a volunteer commentedThanks for the patch!
Comment #6
joaogarin CreditAttribution: joaogarin commentedPatch is working for me as well. Just tried it with latest version of avanced aggeegation. Thanks for the patch
Comment #7
klausiSmall tweak of the patch: If advagg module is disabled then this patch causes "Notice: Undefined index: #aggregate_callback in omega_element_info_alter() (line 28 of omega/omega/template.php)."
Instead, we can check for
empty($elements['scripts']['#aggregate_callback'])
in the beginning. Patch attached.