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.
Advagg seems to be skipping JS in the header. The CSS is compressed and has a path /advagg_css/css__.....css
Then the JS is not in /advagg_js/ but instead /sites/deafault/files/js/ and it is not compressed
Then there is more JS in the footer which is compressed and in the correct path
Comment | File | Size | Author |
---|---|---|---|
#10 | advagg-2896853-10-process_html-override-alt.patch | 578 bytes | mikeytown2 |
| |||
Screen Shot 2017-07-20 at 10.53.32 AM.png | 60.62 KB | plinto | |
Screen Shot 2017-07-20 at 10.53.08 AM.png | 163.9 KB | plinto |
Comments
Comment #2
mikeytown2 CreditAttribution: mikeytown2 commentedWhat theme are you using?
Comment #3
plinto CreditAttribution: plinto commentedI am using a subtheme of Adaptive theme 7.x-3.4
Comment #4
plinto CreditAttribution: plinto commentedComment #5
mikeytown2 CreditAttribution: mikeytown2 commentedWhich sub theme? I test with adaptive theme on a regular basis. The template.php file from the sub theme is where the problem is most likely.
Comment #6
plinto CreditAttribution: plinto commentedI am using a custom sub-theme generated from the adaptive theme sub-theme ( at_subtheme).
I've looked at my templete.php but don't see anything strange.
I did notice that all js in the footer (which is correctly aggregated) has the scope defined to footer (drupal_add_js(libraries_get_path('flip').'/dist/jquery.flip.min.js', array('type' => 'file', 'scope' => 'footer'));). All scripts that have the scope set to header, or not set do not get aggregated by advagg.
E.g.
The picture module set the scope of it's js as footer, so it is aggregated in the footer.
The fancybox module does not set the scope so it is in the header /sites/default/files/js/...
I am also loading 3 js scripts from the .info file (scripts[] = ../../libraries/object-fit-images/dist/ofi.browser.js) and the script is in the header
Comment #7
plinto CreditAttribution: plinto commentedI think I found the issue:
It seems removing this from the template.php solved the problem
Thanks for the help!
Comment #8
mikeytown2 CreditAttribution: mikeytown2 commentedComment #9
mikeytown2 CreditAttribution: mikeytown2 commentedComment #10
mikeytown2 CreditAttribution: mikeytown2 commentedComment #12
mikeytown2 CreditAttribution: mikeytown2 commentedIf you rename that function to XXXXXXX_preprocess_html and remove
$vars['scripts'] = drupal_get_js();
it should work as expected.