In Drupal 5 you could call drupal_get_js or drupal_get_css in hook_footer. Now those calls do not work. This might just be a documentation issue, with a recommendation to move those calls to the updated hook_init function.
In Drupal 5 you could call drupal_get_js or drupal_get_css in hook_footer. Now those calls do not work. This might just be a documentation issue, with a recommendation to move those calls to the updated hook_init function.
Comments
Comment #1
theborg commentedI cannot reproduce it on a fresh install.
drupal_get_css()on a hook_footer function is working.Comment #2
starbow commentedSorry, bad typing on my part. I meant drupal_add_css and drupal_add_js
Comment #3
dvessel commentedAdd to where? Most js is added to the header and css has no business being added that late. By the time hook_footer is run, it's too late. Could you give a specific example?
Comment #4
starbow commentedLike I said, this could just be a documentation issue, but in Drupal 5 you can put those drupal_add_* calls into hook_footer and they will work fine.
Comment #5
dvessel commentedLooks like it is. The order it's called has been changed. Makes more sense in 6.
http://api.drupal.org/api/function/phptemplate_page/5
http://api.drupal.org/api/function/template_preprocess_page/6
hook_footer is invoked from theme_closure.
Comment #6
Barry Madore commentedChanging component
Comment #7
Wolfflow commentedFYI: this is only an example of
drupal_add_js: tested and works on drupal 5Use Drupal JS Libraries : Your own collapsible fieldset
might help. Kind Regards
Comment #8
Wolfflow commentedMark this code needs review by Author
Comment #9
MGParisi commentedcomment says it works... Fixed
Comment #10
jhodgdonIt seems to me that this is still a doc issue: a note needs to be added somewhere that when updating themes from D5 to D6, you cannot call drupal_add_css() in the footer any more and expect it to work. It looks like drupal_add_js in the footer might still work.
The comment above only says that *get* works in the footer, not *add*.
Comment #11
MGParisi commentedInstead of changing status and suggesting how things should be fixed, why don't you fix them? As for me... I am done working on the issue queue for documentation. I don't need this... This issue is a year old, and once again someone puts it off to sink to the bottom of the issue queue, where I fished it out from!
Comment #12
add1sun commented@MGParisi, please don't take issue status changes as personal. If someone notices that something needs to be fixed, then we need to have an open issue and continue working on it. Just because someone notes an issues, doesn't mean that can fix it themselves or right away - or sometimes they want more confirmation before proceeding.
I understand the drive to close issues, but they do serve an important purpose and just because an issue is old doesn't mean that it isn't still a valid problem we need to address.
Comment #13
jhodgdonThis has now been fixed -- I realized it was a module development issue, not a theme development issue. It's now added to http://drupal.org/node/114774 (5.x to 6.x module migration guide).