diff --git a/core/modules/views_ui/src/Form/Ajax/ConfigHandler.php b/core/modules/views_ui/src/Form/Ajax/ConfigHandler.php index bdad87b..db7536b 100644 --- a/core/modules/views_ui/src/Form/Ajax/ConfigHandler.php +++ b/core/modules/views_ui/src/Form/Ajax/ConfigHandler.php @@ -172,10 +172,10 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#value' => $this->t('Remove'), '#submit' => array(array($this, 'remove')), '#limit_validation_errors' => array(array('override')), - '#ajax' => array( - 'path' => current_path(), - ), ); + if ($form_state->get('ajax')) { + $form['actions']['remove']['#ajax']['path'] = $form_state->get('path'); + } } if ($save_ui_cache) {