Commit a48aa76c authored by webchick's avatar webchick

Issue #2370313 by olli: D8 - Exposed filter - "This webpage has a redirect loop" on Reset

parent 118abbcc
......@@ -327,6 +327,9 @@ public function resetForm(&$form, FormStateInterface $form_state) {
$form_state->setRebuild();
$this->view->exposed_data = array();
}
$form_state->setRedirect('<current>');
$form_state->setValues([]);
}
}
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment