diff --git a/core/modules/views/src/Plugin/views/exposed_form/ExposedFormPluginBase.php b/core/modules/views/src/Plugin/views/exposed_form/ExposedFormPluginBase.php index cf21590a5087d1dc30cb45fa4b3274884f737bcb..3652e8be28ef41b6a1d9d4b2d4e3052c515735f2 100644 --- a/core/modules/views/src/Plugin/views/exposed_form/ExposedFormPluginBase.php +++ b/core/modules/views/src/Plugin/views/exposed_form/ExposedFormPluginBase.php @@ -327,6 +327,9 @@ public function resetForm(&$form, FormStateInterface $form_state) { $form_state->setRebuild(); $this->view->exposed_data = array(); } + + $form_state->setRedirect(''); + $form_state->setValues([]); } } diff --git a/core/modules/views/src/Tests/Plugin/ExposedFormTest.php b/core/modules/views/src/Tests/Plugin/ExposedFormTest.php index 1fa0c19d28c577bf9304b672e904c53ddbb9dbb9..c6bc33556d1579c6dc472be7db9c91a5f3c10b80 100644 --- a/core/modules/views/src/Tests/Plugin/ExposedFormTest.php +++ b/core/modules/views/src/Tests/Plugin/ExposedFormTest.php @@ -101,6 +101,11 @@ public function testResetButton() { // Test the button is hidden after reset. $this->assertNoField('edit-reset'); + // Test the reset works with type set. + $this->drupalGet('test_exposed_form_buttons', array('query' => array('type' => 'article', 'op' => 'Reset'))); + $this->assertResponse(200); + $this->assertFieldById('edit-type', 'All', 'Article type filter has been reset.'); + // Rename the label of the reset button. $view = Views::getView('test_exposed_form_buttons'); $view->setDisplay();