2
宛先パラメータが設定されていても、送信ハンドラで強制的にリダイレクトする
カスタムサブミットハンドラーを追加し、フォームがサブミットされた後にカスタムルートにリダイレクトします。 これは私が使ったものです use Drupal\Core\Form\FormStateInterface; use Symfony\Component\HttpFoundation\Request; use \Drupal\Core\Url; function MYMODULE_form_alter(&$form, FormStateInterface $form_state, $form_id) { if ($form_id == 'node_trends_form' || $form_id == 'node_trends_edit_form') { foreach (array_keys($form['actions']) as $action) { if ($action != 'preview' && isset($form['actions'][$action]['#type']) && $form['actions'][$action]['#type'] === 'submit') { $form['actions'][$action]['#submit'][] = 'zyetondev_sync_trends_submit'; } } } } function zyetondev_sync_trends_submit(array $form, FormStateInterface …
9
8
redirection