Skip to content
Snippets Groups Projects
Commit 13aba64f authored by Péter Keszthelyi's avatar Péter Keszthelyi Committed by Andras Szilagyi
Browse files

Issue #3255007 by keszthelyi, andras_szilagyi, smulvih2, vensires, aporie,...

Issue #3255007 by keszthelyi, andras_szilagyi, smulvih2, vensires, aporie, khiminrm: Form submit redirect URL is keeping filter query parameters when all filters are removed
parent 7868c815
Branches
Tags
1 merge request!24Issue #3255007: Form submit redirect URL is keeping filter query parameters when all filters are removed
Pipeline #361228 failed
......@@ -187,7 +187,7 @@ class FacetsForm extends FormBase {
// If there are no active filters, we redirect to the current URL without
// any filters in the URL but still preserving non-filter query parameters.
$form_state->setRedirectUrl($this->buildRedirectUrl());
$form_state->setRedirectUrl($this->buildRedirectUrl(TRUE));
}
/**
......
......@@ -133,6 +133,18 @@ class IntegrationTest extends BrowserTestBase {
$assert->checkboxChecked('item', $form);
$assert->checkboxChecked('article', $form);
$assert->elementsCount('css', '.views-row', 5);
$form->uncheckField('item');
$form->uncheckField('article');
$form->pressButton('Apply');
// Check query string preservation after removing all filters.
$this->assertCurrentUrl('search-api-test-fulltext?foo=bar&baz[]=qux&baz[]=quux');
$form->checkField('item');
$form->checkField('article');
$form->pressButton('Apply');
$this->assertCurrentUrl('search-api-test-fulltext?foo=bar&baz[]=qux&baz[]=quux&f[0]=llama:article&f[1]=llama:item');
$assert->checkboxChecked('item', $form);
$assert->checkboxChecked('article', $form);
$assert->elementsCount('css', '.views-row', 5);
// Check query string preservation after resetting the filters.
$page->clickLink('Reset');
$this->assertCurrentUrl('search-api-test-fulltext', [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment