Skip to content

Commit 9951581

Browse files
committed
Fix how we get the value of a query parameter in the layout template
1 parent 5e48501 commit 9951581

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

templates/layout.html.twig

+3-3
Original file line numberDiff line numberDiff line change
@@ -296,11 +296,11 @@
296296
<div class="form-widget">
297297
<twig:ea:Icon name="internal:search" class="content-search-icon" />
298298

299-
<label class="content-search-label" data-value="{{ app.request.get('query') }}">
300-
<input class="form-control {{ app.request.get('query') is null ? 'is-blank' }}" type="search" name="query" value="{{ app.request.get('query') ?? '' }}" placeholder="{{ t('action.search', ea.i18n.translationParameters, 'EasyAdminBundle')|trans }}" spellcheck="false" autocorrect="off" onInput="this.parentNode.dataset.value=this.value"{% if ea.crud.currentAction == 'index' and ea.crud.autofocusSearch == true %} autofocus="autofocus"{% endif %}>
299+
<label class="content-search-label" data-value="{{ app.request.query.get('query') }}">
300+
<input class="form-control {{ app.request.query.get('query') is null ? 'is-blank' }}" type="search" name="query" value="{{ app.request.query.get('query') ?? '' }}" placeholder="{{ t('action.search', ea.i18n.translationParameters, 'EasyAdminBundle')|trans }}" spellcheck="false" autocorrect="off" onInput="this.parentNode.dataset.value=this.value"{% if ea.crud.currentAction == 'index' and ea.crud.autofocusSearch == true %} autofocus="autofocus"{% endif %}>
301301
</label>
302302

303-
{% if app.request.get('query') %}
303+
{% if app.request.query.get('query') %}
304304
{% set search_reset_url = ea_url().unset('query') %}
305305
{% if ea.usePrettyUrls %}
306306
{% set search_reset_url = ea_url().unset('query').setController(crudController).setAction('index').set('page', 1) %}

0 commit comments

Comments
 (0)