I want to do redirectionredirect users with RedirectResponse:RedirectResponse
and display a message, but the message is not displayed.
$response = new RedirectResponse($url);
$response->send();
and display the message after the redirection. But message isn't displayed.
AfterAfter little debugging I found that my initial (source) urlURL is loaded twice, and drupalthe messages (viaadded with drupal_set_message()
) are removingremoved from $_SESSION
the session in function drupal_get_messages()
. So I have no messages on my target $url
.
Could somebody give me an adviceHow can I achieve this?
Thanks in advance.
P.S. I'm doing it in hook_field_widget_form_alter()
.