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.
This patch moves the call to theme('closure') into process_page so that it runs later in the theming flow. This is necessary because other functions might add JavaScript to the footer scope which is not output correctly when closure is called that early.
Comment | File | Size | Author |
---|---|---|---|
closure.patch | 751 bytes | kkaefer | |
Comments
Comment #1
tic2000 CreditAttribution: tic2000 commentedTo make things a little bit clearer. In HEAD's current state you can't add javascript to $closure (footer scope) using #attached_js.
Like this for example (change in toolbar.module):
This patch fixes the problem as advertised.
I feel bold so I will RTBC after bot gives it a run.
Comment #2
yched CreditAttribution: yched commentedMind giving a look at #469242: Move <head> outside page.tpl.php ? Seems really related.
Comment #3
joshmillerI have checked the code syntax and all looks good. The bot is happy.
Does anyone think this needs a test to ensure that closure is called at the right time?
Comment #4
tic2000 CreditAttribution: tic2000 commentedIt may touch the problem in the process, but I can't test if it will fix this problem because it needs a re-roll first.
Comment #5
tic2000 CreditAttribution: tic2000 commentedCrossposted.
I don't have an answer for the question.
Comment #6
tic2000 CreditAttribution: tic2000 commented#469242: Move <head> outside page.tpl.php hit a dead end it seams so this should go in.
drupal_render has no test for #attached_css or #attached_js so if a test is needed it should be a new issue and not hold this one.
Comment #7
tic2000 CreditAttribution: tic2000 commentedI opened #522782: Test #attached for tests.
Comment #8
moshe weitzman CreditAttribution: moshe weitzman commentedNo more dead end for #469242: Move <head> outside page.tpl.php. I suggest waiting on this a bit.
Comment #9
tic2000 CreditAttribution: tic2000 commented#519782: Change $closure to become a hidden region like page_top got committed. This is no longer an issue.