I am running three sites (one in Italian, one in German, one in Dutch) of a common Drupal 4.6.0 code base. I have been working away for two days configuring them, and am just ready to go live, when all of a sudden my Italian site completely stops working with the following message:

Fatal error: Call to undefined function: drupal_set_html_head() in /home/gmpmprdg/public_html/460/modules/jsdomenu/jsdomenu.module on line 107

I wanted to post the code in this post (in php tags) - but every time I try to do so I get "Terminated because of suspicious input data"!!!!

Bizarrely, the German and Dutch sites continue to work fine, and off an identical code base obviously. I am completely mystified as to why I should not be able to find a Drupal core module all of a sudden - and would be very grateful if anybody had any ideas.

Many thanks, JG

Comments

frjo’s picture

jsdomenu.module is not a core module.

My guess is that jsdomenu.module has a problem with Drupals cache function. The "Call to undefined function" error is a indication of this.

If my guess is correct then you have three choices:
* Stop using the jsdomenu.module
* Stop using the cache function
* Fix the jsdomenu.module so it support Drupals cache function.

joel_guesclin’s picture

Thanks for the tip - I will investigate this. I know that jsdomenu is not core, but I was referring to drupal_set_html_head, which is called to load references to javascript files in HTML HEAD.

In jsdomenu, drupal_set_html_head is called from hook_init - is this not the appropriate place? I notice that there is apparently a possibility to put it into hook_menu - is this right? Instinctively, hook_menu seemed a bit odd. Also, I don't really understand the $may_cache variable - if I call hook_menu how should I set this?

frjo’s picture

Here are one example from the code.module.

To learn more about Drupals hooks etc. go to http://drupaldocs.org/.

/**
 * Implementation of hook_menu()
 */
function codefilter_menu($may_cache) {
  if (!$may_cache) {
    drupal_set_html_head('foobar');
  }
}

(I put in "foobar" so Drupal.org would not terminated my comment.)

joel_guesclin’s picture

I tried altering my implementation so that I called hook_menu instead of hook_init; the code now reads:

/**
 * Implementation of hook_menu().
 */
function jsdomenu_menu() {
  if (!$may_cache) {
    jsdomenu_set_head();
    }
}

The jsdomenu_set_head is the function that calls drupal_set_html_head.

This did not appear to make any difference - so I tried turning off caching. And this seems to have worked, so I presume it is due to some kind of problem in the cache implementation.

frjo’s picture

I think you should change from

function jsdomenu_menu()

to

function jsdomenu_menu($may_cache)