From 5c45839b5b4cd51a2f865d95abbaff37c10eacb2 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 31 Oct 2024 14:41:19 +0100 Subject: [PATCH] Bug 30397: Remove duplicate entry from length menu of patrons search If you have 20 in PatronsPerPage, there will be two 20 entries in the length menu of the patrons search. jQuery.unique is stupid it seems, it requires the array to be sorted (?) let x = [1, 2, 1, 2] jQuery.unique(x); Array(4) [ 1, 2, 1, 2 ] x = [1, 1, 2, 2] jQuery.unique(x); Array [ 1, 2 ] Signed-off-by: David Nind Signed-off-by: Lucas Gass Signed-off-by: Katrin Fischer (cherry picked from commit 60249a979cdf14f78c4d0a777a8f9f536272aa29) Signed-off-by: Lucas Gass --- koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc index 5f73e30f40..74ec8d5a4f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -316,9 +316,8 @@ // Build the aLengthMenu let aLengthMenu = [ - [% Koha.Preference('PatronsPerPage') | html %], 10, 20, 50, 100, -1 + ...new Set([[% Koha.Preference('PatronsPerPage') | html %], 10, 20, 50, 100, -1]) ]; - jQuery.unique(aLengthMenu); aLengthMenu.sort(function( a, b ){ // Put "All" at the end if ( a == -1 ) {