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

8.0.x
webchick 2014-12-29 12:08:05 -08:00
parent 118abbcc6f
commit a48aa76c43
2 changed files with 8 additions and 0 deletions

View File

@ -327,6 +327,9 @@ abstract class ExposedFormPluginBase extends PluginBase {
$form_state->setRebuild();
$this->view->exposed_data = array();
}
$form_state->setRedirect('<current>');
$form_state->setValues([]);
}
}

View File

@ -101,6 +101,11 @@ class ExposedFormTest extends ViewTestBase {
// 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();