Skip to content

Commit

Permalink
Fix for the issue "Query parameters are lost during filtering #739" (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sirielua authored Jan 14, 2023
1 parent c016fb7 commit 813c1b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Helper/Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public function filter(SlidingPaginationInterface $pagination, array $fields, ar
return \array_merge(
$pagination->getPaginatorOptions() ?? [],
$pagination->getCustomParameters() ?? [],
\compact('fields', 'action', 'filterFieldName', 'filterValueName', 'selectedField', 'selectedValue', 'options')
\compact('fields', 'action', 'filterFieldName', 'filterValueName', 'selectedField', 'selectedValue', 'options', 'params')
);
}
}
6 changes: 5 additions & 1 deletion templates/Pagination/filtration.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
{% else %}
<input type="hidden" name="{{ filterFieldName }}" value="{{ fields|keys|first }}" />
{% endif %}

{% if params|length > 0 %}
{% for param, value in params %}
<input type="hidden" name="{{ param }}" value="{{ value }}"/>
{% endfor %}
{% endif %}
<input type="text" value="{{ selectedValue }}" name="{{ filterValueName }}" />

<button>{{ options.button }}</button>
Expand Down

0 comments on commit 813c1b2

Please sign in to comment.