I want to redirect users with RedirectResponse
and display a message, but the message is not displayed.
$response = new RedirectResponse($url);
$response->send();
After little debugging I found that my initial (source) URL is loaded twice, and the messages (added with drupal_set_message()
) are removed from the session in drupal_get_messages()
. So I have no messages on my target $url
.
How can I achieve this?
I'm doing it in hook_field_widget_form_alter()
.