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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeytown2’s picture

Status: Active » Needs review
FileSize
861 bytes
joelpittet’s picture

+++ b/omega/template.php
@@ -25,12 +25,14 @@ if (!element_info('scripts')) {
+  if (empty($elements['scripts']) || $elements['scripts']['#aggregate_callback'] === 'drupal_pre_render_scripts') {

Is there any case where omega info alter would happen before advagg's?

mikeytown2’s picture

It 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.

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

Ok cool, this seems to do the trick. Thanks again @mikeytown2

dolphinonmobile’s picture

Thanks for the patch!

joaogarin’s picture

Patch is working for me as well. Just tried it with latest version of avanced aggeegation. Thanks for the patch

klausi’s picture

FileSize
884 bytes

Small 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.