Fatal error: Call to undefined function: drupal_set_html_head() in /srv/www/htdocs/dfa/modules/quote.module on line 24
I've just finished (mostly) a fresh install of Drupal. I added in the quote.module, and it seems to work fine... until I log out. When the user is anonymous, I get the above error message at the bottom of the Home page.
As I understand it, the drupal_set_html_head() function is part of the Drupal core so it should be there. I don't know enough about PHP to figure out what's going on.
Can anyone reproduce this? I can provide the permission settings for the "anonymous user" role if that would help.
Comments
Comment #1
Capnj commentedI get it in one of my installations, but not in another one and they're both running drupal 4.4.1, I think.
Comment #2
(not verified) commentedI get the following error aswell:
Fatal error: Call to undefined function: drupal_set_html_head() in /home/trizock/public_html/infusion/modules/quote.module on line 24
But the error only displays to Anonymous Users. I have looked all through my permissions settings and cant find anything that would cuase the error. Please post a fix and help me out!!!
Comment #3
dmjossel commentedI also get the same error in Drupal 4.4 with version 4.4 of the quote module. The real problem is that this error also displays in RSS feeds, invalidating the feed. As it doesn't appear possible for RSS aggregators to have accounts, and this error only appears to affect anonymous browsers, there is currently no workaround except to disable quote.module.
Comment #4
dmjossel commentedI found a workaround by looking in the commentrss module. Instead of drupal_set_html_head on line 24, use drupal_set_header. That seems to work, and no more errors in the RSS feed.
Comment #5
(not verified) commentedI did the following change:
So line 24 in quote.module now looks like this:
drupal_set_header(quote_html_head());
BUT
Now I get the following error sometimes:
Fatal error: Call to undefined function: drupal_set_header() in /home/trizock/public_html/infusion/modules/quote.module on line 24
Please help..?
Comment #6
TDobes commentedThis bug was caused by the interaction between page caching and quote.module.
quote.module was attempting to call the drupal_set_html_head function even on cached page views. drupal_set_html_head is defined in common.inc, which does not get included on cached page views, so this caused an error. I have moved the call to the _link hook in 4.4 and the _menu hook in CVS, which should fix the problem.
The drupal_set_header function is meant for changing HTTP headers (it ends up getting fed to the PHP header() function). It should not be used for referencing CSS, which is what quote.module is doing.
I have fixed this problem in versions 1.8.4.1 (for 4.4) and 1.11 (for CVS)... you can check your version by reading the second line of quote.module. Also, note that the error message may persist because it has been stored in Drupal's cache... I believe you can clear the cache by going to admin->configuration (or admin->settings on CVS) and clicking "Save configuration."
Comment #7
(not verified) commentedI dont understand what i have to do...
Do i have to edit the file or have you uploaded the fix file or what?
Comment #8
(not verified) commentedThe fix has been upload to CVS... download the latest 4.4 version and the problem should be fixed.
Comment #9
(not verified) commentedComment #10
ElFroggitos commentedNot yet fixed: I use 4.5.2 and I get:
Fatal error: Call to undefined function: drupal_set_html_head() in /opt/lampp/htdocs/dpal/modules/fontsize/fontsize.module on line 18
It happened during:
1. After logging out as user1 and logging as user2.
2. editing of node after multiple previews to see the changes.
Comment #11
(not verified) commentedElFroggitos: uhm... no. The error you're receiving is clearly coming from fontsize.module and has absolutely nothing to do with quote.module. There doesn't appear to be a fontsize.module project here on drupal.org, so you'll have to contact the module developer directly. (maybe her/his e-mail is specified in the README)