Redirect after submitting custom entity form I'm working with a custom entity and would like to programmatically set the redirect based on submitted values.

When I set the redirect path however, the user is redirected to the canonical path instead of the path I'm setting in the redirect.

In the file mymodule/src/Form/MyEntityForm.php, I'm doing something like this:

  public function submitForm(array &amp;$form, FormStateInterface $form_state)
  {
    // Note: Same results with the order of the next 2 lines reversed.
    parent::submitForm($form, $form_state);
    $form_state-&gt;setRedirect('mymodule.overview', ['state' =&gt; 'CA']);
  }


So how would I set the destination of an entity form submission dynamically?
Probably you need to override EntityFormInterface::save(): 


  Form submission handler for the 'save' action.
  
  Normally this method should be overridden to provide specific messages
  to the user and redirect the form after the entity has been saved.


submitForm() is the first submit handler called and should not be used to override submit actions.