I'm in the process of porting my modules from D7 to D8. No real problems so far, but...
I have a multistep form from where I need to redirect to /node/add/xyz in the last step. (All required input form data is stored in D8 TempStore before the redirect). In d7 I used the simple and functional drupal_goto('node/add/xyz') function which is gone in D8 for whatever reason.
I looked into core modules to see how it is done in the D8 way and it seems RedirectResponse() from the Symfony routing system is the way to go. However doing something like this:
return new RedirectResponse(url('node/add/xyz', array('absolute' => TRUE)));
But this is silently ignored, no error, nothing. I read that doing RedirectResponse from somewhere in the code may not work. So my next idea of doing it was to use a form redirect in this way:
$form_state['redirect_route'] = array(
'route_name' => 'node.add',
'route_parameters' => array(
'node_type' => 'xyz',
),
);
even without any effect. I'm out of ideas and wish drupal_goto() back. Hopefully someone out there can help me out!
Thanks in advance bzrudi
return
code?RedirectResponse
yet in Drupal 8 so this is likely to be a bug in the OP's code.