diff --git a/templates/components/dropdown/limit.html.twig b/templates/components/dropdown/limit.html.twig index 28552b76050..4297b020c3e 100644 --- a/templates/components/dropdown/limit.html.twig +++ b/templates/components/dropdown/limit.html.twig @@ -40,7 +40,8 @@ {% endif %} {% if not no_onchange %} - {% set href = "location.href='" ~ href ~ "glpilist_limit='+this.value+'" ~ additional_params ~ "'" %} + {% set href_separator = '?' in href ? '&' : '?' %} + {% set href = "location.href='" ~ href ~ href_separator ~ "glpilist_limit='+this.value+'" ~ additional_params ~ "'" %} {% if is_tab is defined and is_tab == true %} {% set href = "javascript:reloadTab('glpilist_limit='+this.value+'" ~ additional_params ~ "');" %} {% endif %} diff --git a/templates/components/pager.html.twig b/templates/components/pager.html.twig index 313e18d792f..862e7835f65 100644 --- a/templates/components/pager.html.twig +++ b/templates/components/pager.html.twig @@ -39,7 +39,8 @@ {% endif %} {% endif %} -{% set href = href ~ "&start=%start%" ~ additional_params %} +{% set href_separator = '?' in href ? '&' : '?' %} +{% set href = href ~ href_separator ~ "start=%start%" ~ additional_params %} {% if is_tab is defined and is_tab == true %} {% set href = "javascript:reloadTab('start=%start%" ~ additional_params ~ "');" %} {% endif %} @@ -71,6 +72,7 @@ {% set limitdropdown = include('components/dropdown/limit.html.twig', { 'no_onchange': fluid_search|default(false), 'select_class': 'search-limit-dropdown', + 'href': href|replace({'%start%': start}), }) %} {{ __('%s rows / page')|format(limitdropdown)|raw }} diff --git a/templates/pages/admin/events_list.html.twig b/templates/pages/admin/events_list.html.twig index 957d7dbf97f..d5e448bf977 100644 --- a/templates/pages/admin/events_list.html.twig +++ b/templates/pages/admin/events_list.html.twig @@ -43,7 +43,7 @@
{% if count > 0 %} {% set limitdropdown = include('components/dropdown/limit.html.twig', { - 'href': target ~ '?', + 'href': target, 'additional_params': 'sort=' ~ sort ~ '&order=' ~ order }) %}