From 60249a979cdf14f78c4d0a777a8f9f536272aa29 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 --- 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 d2eef529c7..ed5516f05d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -347,9 +347,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 ) { -- 2.39.5