Problem
When a CRUD index page is opened with custom query parameters (e.g. menu-driven list context such as _status, _discipline, or sort state), those parameters are correctly preserved in links generated by AdminUrlGenerator / ea_url(), but they are lost when submitting the index search form in real browsers.
This is because the search form uses method="get". Browsers only submit form fields, not the query string embedded in the form action URL.
Example
- Open
/admin/exercise?_status=to_complete
- Search for
squat
- Browser navigates to
/admin/exercise?query=squat — _status is gone
Functional tests using Symfony's KernelBrowser may pass without a workaround because the test client merges query parameters differently than real browsers.
Current workarounds
- Override
search_form_filters in a custom crud/index template and add hidden fields for each custom parameter manually
- Migrate list context to official EasyAdmin
Filters (filters[...]), which are already re-applied on search via hidden fields in layout.html.twig
Expected behavior
Custom query parameters that are not reserved EasyAdmin keys should survive search submissions, the same way:
Related history
Proposed solution
Reuse the same hidden-field approach as the filters modal: preserve all remaining query parameters in the search form, excluding reserved keys (query, page, filters, batch params, etc.).
Problem
When a CRUD index page is opened with custom query parameters (e.g. menu-driven list context such as
_status,_discipline, or sort state), those parameters are correctly preserved in links generated byAdminUrlGenerator/ea_url(), but they are lost when submitting the index search form in real browsers.This is because the search form uses
method="get". Browsers only submit form fields, not the query string embedded in the formactionURL.Example
/admin/exercise?_status=to_completesquat/admin/exercise?query=squat—_statusis goneFunctional tests using Symfony's
KernelBrowsermay pass without a workaround because the test client merges query parameters differently than real browsers.Current workarounds
search_form_filtersin a customcrud/indextemplate and add hidden fields for each custom parameter manuallyFilters(filters[...]), which are already re-applied on search via hidden fields inlayout.html.twigExpected behavior
Custom query parameters that are not reserved EasyAdmin keys should survive search submissions, the same way:
filters[...]parameters already do (see [3.5.9] Searching does not respect active filters #4707)form_action_query_string_as_array|ea_flatten_arrayinfilters.html.twigRelated history
Proposed solution
Reuse the same hidden-field approach as the filters modal: preserve all remaining query parameters in the search form, excluding reserved keys (
query,page,filters, batch params, etc.).