I installed the Node (key)words module version 4.6.0 on newest drupal 4.6.0 RC.

Whenever logging out, I get the following error:

Fatal error: Call to undefined function: drupal_set_html_head() in /home3/sub007/sc11519-EPMC/www/eli/modules/nodewords/nodewords.module on line 128

Best
Lennart

Comments

lennart’s picture

Title: Fatal error on logout » Fatal error on logout - only when "cache" enabled

The error only occurs after having been logged in for some time with "cache" enabled. And then logging out.

Thus, it might be difficult to reproduce the bug.

Best
Lennart

lennart’s picture

Priority: Normal » Critical

The error is recurring. When cache is enabled the error occurs to anyone not logged in. In fact you cannot even get to log in since the error occurs when directing the URL to foo.org/ and foo.org/user

alliax’s picture

I also just got it, same thing, I install drupal, don't use cache, put the nodewords module, create content, etc. Then I activate cache for the first time and once I log out after editing some nodes, it says :
Fatal error: Call to undefined function: drupal_set_html_head() in /home/mysite/public_html/modules/nodewords/nodewords.module on line 128

I then use the database to disable the cache module in the 'system' table, but I found out that there is NO cache module entry in the table.
So I went to the 'cache' table only to find that some of the latest entries had very strange looking characters instead of the expected content in the 'data' field.
In those entries the 'expire' field were set to -1 instead of a correct timestamp value.

When I deleted those entries, the site went back to normal.

I log in as admin, don't edit anything and log out, the same thing happpen and I got new corrupted entries in the 'cache' table. I then delete them, log in again, disable the cache settings in administrer -> settings
and I log out, and it's fine, no error.

I then realised that the cache settings wasn't a module and so wasn't to be found in the 'system' table. You can disable it from the 'variables' table, there is an entry nammed : cache
with a value of : s:1:"1";
you should replace one or both "1" with "0" in order to disable the cache setting.

Maybe it is related, I had in the watchdog log regularly errors that typically say :

"
Duplicate entry 'locale:en' for key 1 query: INSERT INTO drpl_cache (cid, data, created, expire, headers) VALUES ('locale:en', 'a:1795:{s:4:\"view\";s:4:\"voir\";s:18:\"View user profile.\";s:27:\"Voir le profil utilisateur.\";s:3:\"php\";s:3:\"php\";s:8:\"security\";s:10:\"sécurité\";s:7:\"Enabled\";s:7:\"Activé\";s:7:\"Default\";s:7:\"Défaut\";s:10:\"Operations\";s:11:\"Opérations\";s:6:\"delete\";s:9:\"supprimer\";s:18:\"Save configuration\";s:28:\"Sauvegarder la configuration\";s:12:\"Add language\";s:18:\"Ajouter une langue\";s:6:\"Import\";s:8:\"Importer\";s:6:\"Export\";s:8:\"Exporter\";s:17:\"Save translations\";s:27:\"Sauvegarder les traductions\";s:4:\"edit\";s:7:\"éditer\";s:8:\"Language\";s:6:\"Langue à la ligne 66 du fichier /home/mysite/public_html/includes/database.mysql.inc.
"

it fails regularly on its insertions into the "cache" table and I didn't have the cache setting on.

Could it be related ?

Eric Scouten’s picture

Assigned: Unassigned » Eric Scouten
StatusFileSize
new1.42 KB

Attached patch fixes this problem.

Also fixed: On non-node pages, global keywords were printed twice.

Eric Scouten’s picture

*sigh* No, this doesn't fix it. The site will work, but the keywords are missing if you're logged out. Investigating...

Eric Scouten’s picture

StatusFileSize
new1.79 KB

Corrected patch.

Also note if you're trying to reproduce the bug (before patch): The bug only happens once the page has been cached. If you have an empty cache, the first page view will work. Second and succeeding views of the same page will fail.

lennart’s picture

Thanks for the patch Eric!

Everything appears to work fine now.

smithmb’s picture

Thanks for the patch! It fixed this error for me as well.

Robrecht Jacques’s picture

Status: Needs review » Fixed

Fixed in CVS-HEAD and DRUPAL-4-6.

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

Status: Fixed » Closed (fixed)
Anonymous’s picture

Version: » master
Assigned: Eric Scouten » Unassigned