Was just following an issue in which, making a redirection on the onsubmit callback was not showing status messages I was setting prior instructing this redirect.
It took me a bit to figure out but the reason is quite obvious:
'statusMessages' => theme('status_messages'),
this line on modalframe_close_dialog($args = NULL)
is calling the theme function and then clearing the status messages from the session.
As this function does not give us the option to clear or not clear the issue queue I am thinking of doing a custom theme('modalframe_status_messages', $clear_queue) in which we could, if we want to, pass an optional argument which we can also pass to the modalframe_close_dialog().
I know this is a bit off, but it may be a desired behavior.
Thoughts?
Comments
Comment #1
hanoiiI have sorted out this in the module I am using the modalframe api by doing the following:
so this will send the redirect info to the JS part of the module.
I am backuping the session messages
and then I am doing:
on
hook_init()
And finally, in the JS part of my module:
This works nicely, so leaving here for reference, but still, shall something like this should be included in the api?
Comment #2
crea CreditAttribution: crea commentedSubs
Comment #3
dsnopekYou're right, there probably should be a way to prevent modalframe_close_dialog() from wiping out the messages. Let's try to address this in the Drupal 7 version first.