How to disable redirection to the node after node form submission I have a node form exposed in the front-end to allow visitors to add their organisation to the list of partners. Below the form, I have exposed view block with the list of existing partners.

When a visitor enters a new organisation to the list I want the form just to add a new node type "partner" and reload the page/block without redirecting to the node content (node/[node ID]).

At the beginning I ed taxonomy terms instead and it worked as it should, now I want to achieve the same with node entity.

I have tried various solutions but none of it works correctly and I didn't find much by googling it.

For example, this is not functioning:

function THEME_form_alter(&amp;$form, \Drupal\Core\Form\FormStateInterface &amp;$form_state, $form_id) {
  if ($form_id == 'node_partners_form') {
    $form_state-&gt;disableRedirect(); // This is not functioning
  }
}


This does not work either:

function THEME_form_alter(&amp;$form, \Drupal\Core\Form\FormStateInterface &amp;$form_state, $form_id) {
  if ($form_id == 'node_partners_form') {
    foreach (array_keys($form['actions']) as $action) {
      if ($action != 'preview' &amp;&amp; isset($form['actions'][$action]['#type']) &amp;&amp; $form['actions'][$action]['#type'] === 'submit') {
        $form['actions'][$action]['#submit'][] = 'THEME_node_form_submit';
      }
    }
  }
}

function THEME_node_form_submit($form, &amp;$form_state) {
  $form_state-&gt;setRedirect(Url::fromUri('internal:/node/1')-&gt;toString());
}

=&gt; Error: Route /partners does not exist.


Value of attribute action in the exposed node form is correct and therefore I think the proper solution should be elsewhere then altering form properties - probably it has more with the Drupal behaviour after adding a new node.

&lt;form action="/en/partners"&gt;...&lt;/form&gt;
Thank you for the comment 4k4. Unfortunately, I didn't have enough time to find a proper solution so I just changed the redirection URL to the same content where the form is exposed.

function THEME_node_form_submit($form, FormStateInterface $form_state)  {
    $node_id = 1;
    $form_state-&gt;setRedirect('entity.node.canonical', array('node' =&gt; $node_id));
}


I'll try to find a more appropriate solution if I'll have some extra time before deadline :)