In previous versions of drupal, when a function uses drupal_set_message(), you see the message on the very next screen. In 4.7, it's delayed a screen, so the message doesn't appear until you click a second link. This is happening every time on my test site. For instance, I changed the settings for one of my views in the Views module and hit save. The settings saved, but the usual message (View successfully saved.) didn't appear. I then clicked another link and that message appeared on the that page.

Comments

chx’s picture

Status: Active » Closed (won't fix)

unable to reproduce (yes I am on php5 damned be that version)

lmanavi’s picture

Version: x.y.z » 7.16

Hi, I'm having this same problem. I can't find a solution. I'm not sure if this thread is still active...but I have no idea why it's showing up 1 page late. I've tried debugging, and nothing. It's beyond me why this is happening and I need to find a fix for it as well. If someone has a solution, can you please post it?

jerryplin’s picture

I encounter this problem on 7.18 as well. What information would be helpful to debug?

I edit node.tpl.php to call drupal_set_message, and I then refresh a page. The message does not show up. When I refresh again, the message shows up. I then edit node.tpl.php to not call drupal_set_message. I then refresh the page, and the message still shows up. I then refresh, and the message then does not show up.

jerryplin’s picture

Status: Closed (won't fix) » Active

Just upgraded to 7.20 and confirmed that this issue still occurs. I imagine that there is something special about my particular setup, since it would seem to be pretty high priority if this affected everyone. The problem is that my installation is pretty standard, and I don't even know where to start debugging.

I'm setting this to active in hopes that someone will take a look.

seanr’s picture

I haven't seen this since I originally reported the issue except in once specific occurrence: if you dsm in the theme layer, that will end up in the next page load due to the timing of when it gets called. If that's not the case here, then I suspect a module or theme is intercepting it somehow.

chx’s picture

Status: Active » Closed (works as designed)
mattjbondi’s picture

Version: 7.16 » 7.23
Status: Closed (works as designed) » Needs review

Opening this again as I have experienced this twice now. My current set up is like this:

1. node.tpl.php prints the output from a custom module which is just called by theme('my_module')
2. The function call back in the custom module renders a form - drupal_render(drupal_get_form('the_form'))

I have print($messages) as is in page.tpl.php but if I submit the form with errors the fields highlight as they should on refresh - but no messages. These come a screen later, re-loading the page any which way basically. It is as though form_set_error is sending through what it needs to to highlight field errors but the message... well it doesn't make sense why there is a delay on the message and not the field highlights.

Thoughts anyone? Is it the steps I am taking to render the form? Cheers.

EDIT: Just to let you know I tried this method with no luck either: I called the theme('my_module') in preprocess_node in template.php and then spat out the result in node.tpl.php thinking if I called it earlier it may make a difference but nope.

chx’s picture

Status: Needs review » Closed (works as designed)

If you call dsm from a template it can't print the messages as those are already printed into the page.

keyframer’s picture

Just use krumo() directly instead. It will output immediately and break your layout, but for a quick trace this is way better than queuing up a drupal message.

youngpac’s picture

i was facing the same kind of problem. the best solution that worked for me is to place the message in the drupal theme_preprocess_page. Here the message is loaded even before the page is loaded and hence there is no chance of the message being delayed to a later page or upon refresh.