Closed (fixed)
Project:
Drupal core
Version:
x.y.z
Component:
module system
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Aug 2004 at 14:52 UTC
Updated:
18 Sep 2005 at 22:01 UTC
When users aren't logged into my drupal system, the following error message appears at the bottom:
Fatal error: Call to undefined function: drupal_set_html_head() in /home/cocoa/public_html/modules/codefilter/codefilter.module on line 15
As seen on the bottom on this site: http://www.cocoa.se/
however, when a user is logged in it doesn't throw that error.
(I'm running drupal 4.4.2)
Comments
Comment #1
anj commentedI fixed this by moving the offending line (21)
drupal_set_html_head('style type="text/css">@import url(' . $GLOBALS[base_url] . '/modules/codefilter/codefilter.css);');Comment #2
anj commentedI fixed this by moving the offending line (21)
out of the
codefilter_initfunction, and placing it at the start of thecodefilter_filterfunction. Thedrupal_set_html_headfunction is not declared when the modules are initialized, and anyway, I think it makes more sense for the module to only patch the HTML headers if it is actually being invoked for that page. Unless I've misunderstood andcodefiler_filtercan be called more than once per page, in which case we might end up with the same stylesheet being included many times (depending on howdrupal_set_html_headworks).Cheers,
The Stoat.
Comment #3
The Directive commentedCodefilter module does not work in version 4.5.0 because "Fatal error: Call to undefined function: drupal_set_html_head()".
Comment #4
freyquency commentedCodefilter works fine for me in 4.5 and 4.5.1.
But I get the same error with 4.5.2
I think it's actually just the main index page, as when I type in /login to get to the login page it is ok and I'm not logged in yet.
Comment #5
chrisada commentedFor me, this only occurs with caching turned on.
Comment #6
Steven commenteddrupal_set_html_head() is still present in Drupal 4.5.2. Are you sure you're running the right version? Check your includes/common.inc file.
Comment #7
tulula commentedThis started happening to me only today and seemed only after I set up new events which were supposed to be only viewable (node_by_privacy) to all registered users and not anonymous users. Correlation?
Events ARE showing for all users regardless of logged in or not - still, the fatal error is above all the kicker!
Comment #8
Rick Cogley commentedI started getting this problem after I set up multiple db access to the same Drupal source tree, using a symlink for the second domain which was set up w/ Vhosts in apache.
Looking at the error being from codefilter, I managed to access the site using other paths (/node etc) and then disabled it. Now however, I am getting the same error from other modules. Seems like it is just going down the line.
I will try disabling the cache and report back.
Regards
Rick Cogley
Tokyo
Comment #9
Rick Cogley commentedI disabled the cache in both the first "regular" site and my second "symlink" site. The problem has gone away, sort of.
Observations -
* seems to be related to me being logged in on both sites. If I am in my browser (maxthon) and am not logged in, and then switch URLs this error still occurs. However, it is occuring with less zeal than what was happening before with caching enabled.
* sometimes, hand entering the URL in the browser triggers the error from either site, but, clicking on the Home button allows the site to load from the base URL.
Regards,
Rick Cogley
Tokyo
Comment #10
media girl commentedHas anyone learned more about this? I have had numerous people complain about this error and have disabled cache for now. But that hardly seems like a long-term solution. Did that code hack above work?
FWIW, I'm experiencing this error on a 4.5.2 clean installation. I've had no problems (that I know of) on my sites with 4.5.0 and 4.5.1 (which have not been updated for no particular reason).
Thanks!
Comment #11
(not verified) commentedhappened to me after enabling cache.
This is the complete error message.
Fatal error: Call to undefined function drupal_set_html_head() in /usr/home/web/blalba/modules/fckeditor/fckeditor.module on line 60
I'm running Drupal 4.5.2 on PHP5
Comment #12
luigi-1 commentedsorry, last comment was mine
Comment #13
tulula commentedHad this problem until changing caching - now I just tried to install the Internationalization module and PRESTO, problem back again... AND Caching is currently OFF... can't get back in to change that up again! ARGH!
Comment #14
tulula commentedhttp://drupal.org/node/18717
Just added this under Internationalization module issues too... completely hooped here at present
Lisa
Comment #15
Walt Esquivel commentedHi,
First off, I tried submitting this and the on-screen message stated that I must choose a component system. I could be wrong in having chosen "module system", but I went ahead and chose it since this "fatal error" occurs across several different modules and appears to have more to do with caching than a specific module (caching wasn't a choice, or I would have chosen it).
I’m running Drupal 4.6.1 on a Linux server, Apache version 1.3.33 (Unix), Perl version 5.8.1, PHP version 4.3.11, MySQL version 4.0.22-standard. I use Internet Explorer and Windows XP. I'm using 4.6.0 modules (there aren't any 4.6.1 modules as 4.6.1 is really just a bug fix/minor issues fix release).
I kept getting a similar "Fatal error: Call to undefined function: drupal_set_html_head()" type error.
However, it kept identifying modules/nodewords/nodewords.module as the problem instead of the codefilter.module, fckeditor.module, or Internationalization modules. It seems this "fatal error" is not very picky and I agree with this comment that I copied and pasted from the posts below:
#5 submitted by chrisada on January 16, 2005 - 15:13
For me, this only occurs with caching turned on.
It seems to me that when I go to administer->settings and scroll down to "Cache settings" and then under "Cache support:" click on "Enabled", I get the "fatal error" being described all throughout these postings.
I, too, couldn't log in at http://www.mysite.com and then tried http://www.mysite.com/admin/ and was then able to log in. The first thing I did after logging in was DISABLE my cache settings!
I hope that helps,
Walt
Comment #16
Bèr Kessels commentedChanging the title changes it for the whole thread.
Comment #17
tostinni commentedMoving to CVS, this doesn't seem to apply anymore as the function
drupal_set_html_head()exists in common.inc.Should we close this ? At least I think that this is now not critical.
Comment #18
killes@www.drop.org commentedfixed, the user had a mismatch in core/cotnrib version numbers.
Comment #19
(not verified) commentedComment #20
(not verified) commentedComment #21
(not verified) commentedComment #22
(not verified) commentedComment #23
(not verified) commented