I want to do redirection with RedirectResponse:
$response = new RedirectResponse($url);
$response->send();
and display the message after the redirection. But message isn't displayed.
After little debugging I found that my initial (source) url loaded twice and drupal messages (via drupal_set_message
) are removing from $_SESSION
in function drupal_get_messages
. So I have no messages on my target $url
.
Could somebody give me an advice?
Thanks in advance.
P.S. I'm doing it in hook_field_widget_form_alter
.