Skip to content

Commit 96b6be1

Browse files
cconard96trasher
authored andcommitted
fix pager and limit for non-form pages
1 parent a360e6d commit 96b6be1

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

Diff for: templates/components/dropdown/limit.html.twig

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
{% endif %}
4141

4242
{% if not no_onchange %}
43-
{% set href = "location.href='" ~ href ~ "glpilist_limit='+this.value+'" ~ additional_params ~ "'" %}
43+
{% set href_separator = '?' in href ? '&' : '?' %}
44+
{% set href = "location.href='" ~ href ~ href_separator ~ "glpilist_limit='+this.value+'" ~ additional_params ~ "'" %}
4445
{% if is_tab is defined and is_tab == true %}
4546
{% set href = "javascript:reloadTab('glpilist_limit='+this.value+'" ~ additional_params ~ "');" %}
4647
{% endif %}

Diff for: templates/components/pager.html.twig

+3-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
{% endif %}
4040
{% endif %}
4141

42-
{% set href = href ~ "&start=%start%" ~ additional_params %}
42+
{% set href_separator = '?' in href ? '&' : '?' %}
43+
{% set href = href ~ href_separator ~ "start=%start%" ~ additional_params %}
4344
{% if is_tab is defined and is_tab == true %}
4445
{% set href = "javascript:reloadTab('start=%start%" ~ additional_params ~ "');" %}
4546
{% endif %}
@@ -71,6 +72,7 @@
7172
{% set limitdropdown = include('components/dropdown/limit.html.twig', {
7273
'no_onchange': fluid_search|default(false),
7374
'select_class': 'search-limit-dropdown',
75+
'href': href|replace({'%start%': start}),
7476
}) %}
7577
<span class="search-limit d-none d-md-block">
7678
{{ __('%s rows / page')|format(limitdropdown)|raw }}

Diff for: templates/pages/admin/events_list.html.twig

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<div class="card-header search-header pe-0">
4444
{% if count > 0 %}
4545
{% set limitdropdown = include('components/dropdown/limit.html.twig', {
46-
'href': target ~ '?',
46+
'href': target,
4747
'additional_params': 'sort=' ~ sort ~ '&order=' ~ order
4848
}) %}
4949
<div class="ms-auto d-inline-flex align-items-center d-none d-md-block search-limit">

0 commit comments

Comments
 (0)