I want to create multi step form based on tabs created using Fieldgroups. I have been able to alter the ECK form as well as added my own custom submit handler.

In the custom submit handler, I have added a form redirect that redirects to the same form but with a fragment so that the next tab gets shown. I am able to generate the fragment for the route, but its not working. In-fact, the redirect seems to not work at all for any valid internal route. Kindly advise.

Please find the form redirect url.

$url = new Drupal\Core\Url('eck.entity.add'
, ['eck_entity_type' => 'registration_configuration' , 'eck_entity_bundle' => 'config_2']
, ['fragment' => 'edit-group-add']);
  • Can you verify this code is being hit?
    – Kevin
    Commented Sep 7, 2017 at 15:39
  • @Kevin, my form submit code is getting called. I realized the problem was due to the form submit calling the setRebuild() method.
    – Amit Sedai
    Commented Sep 8, 2017 at 7:56

1 Answer 1


I was executing setRebuild()! I added another submit button and started doing the steps in my previous submit logic one by one, then it hit me. Form redirection will not happen if your submit is rebuilding the same form :)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.