For some reason, Drupal stopped showing the messages that normally appear when an admin page (ie. permissions) is updated or when a node is posted or updated. I have print $messages in my page.tpl.php file, but for some reason, the messages just stopped showing up.

Is there a switch somewhere in the config pages that I might have inadvertantly turned off?

Thanks.

Comments

Chris Einkauf’s picture

A few questions...

Did you recently upgrade your theme? Perhaps your theme no longer supports messages.

Did you insert the "print $messages" code yourself? Maybe it's just typed out incorrectly.

On admin/build/modules, do you see a message if you enable/disable a module?

If you view the source code of your page, does the message show up in there? (This would be if in the CSS it's set to "display: none" or something to that effect).

In your page.tpl.php, enter the code below and then look in the variables array for the messages variable when you reload one of your pages. Does it have a value?

<?php
print dsm(get_defined_vars());
?>

Finally, can you think of anything you modified right before the messages went away?

RWWood’s picture

To answer:

No upgrades to theme.

The print $messages code has been there all along, and the messages were being printed.

The no message on admin/build/modules.

Nothing in the source.

Including the statement to print variables returns nothing.

After all that, I tracked it down to the phpfreechat module which I've been testing and which I installed a few days ago. I guess I'll have to file a bug report for that module.

Thanks for helping me sort this out.

Chris Einkauf’s picture

I'm glad you were able to track it down. Seems as if that phpfreechat module was just preventing your theme's page.tpl.php from showing up. Perhaps that module comes with its own page.tpl.php which it uses instead of your theme's, or perhaps it has some code which overrides certain sections of your theme's page.tpl.php (similar to how some modules use hook_form_alter functions, so they can override how certain forms look without necessarily coming with their own tpl.php files for those forms).

RWWood’s picture

Actually, there was already a bug report on the project site. The problem, according to the developer was due to a bug in Drupal 5 which he remedied with this chunk of code:

if ($messages = drupal_set_message()) {
  unset($_SESSION['messages']);

From the thread it appeared the problem didn't exist in Drupal 6, so I commented out that bit and everything seems to be working ok.

Thanks again.