Bug 30397

Summary: Duplicate '20' option in dropdown 'Show entries' menu
Product: Koha Reporter: Séverine Queune <severine.queune>
Component: PatronsAssignee: Jonathan Druart <jonathan.druart>
Status: RESOLVED FIXED QA Contact: Lucas Gass (lukeg) <lucas>
Severity: normal    
Priority: P5 - low CC: david, fridolin.somers, gmcharlt, jesse, jonathan.druart, kyle.m.hall, lucas
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38353
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This fixes the options for the number of entries to show for patron search results in the staff interface - 20 was listed twice.
Version(s) released in:
24.11.00,24.05.06,23.11.11
Circulation function:
Attachments: Bug 30397: Remove duplicate entry from length menu of patrons search
Bug 30397: Remove duplicate entry from length menu of patrons search
Bug 30397: Remove duplicate entry from length menu of patrons search

Description Séverine Queune 2022-03-29 15:01:33 UTC
On the members-home.pl page and the members/search.pl pop-up, the dropdown menu to select the number of shown entries, there is two times the option for '20' results.
Seen on master and 20.11.11
Comment 1 Jonathan Druart 2024-10-31 13:42:52 UTC
Created attachment 173800 [details] [review]
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 ]
Comment 2 David Nind 2024-10-31 21:47:35 UTC
Created attachment 173838 [details] [review]
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 <david@davidnind.com>
Comment 3 David Nind 2024-10-31 21:53:14 UTC
Testing notes (using KTD):
1. In the staff interface, go to Patrons > click the search button under the "Search for patron" section on the left.
2. In the results, select the dropdown list to change the number of entries for the results (the default is 20).
3. Note that 20 appears twice.
4. Apply the patch.
5. Restart everything: restart_all
6. Repeat steps 1-2:
   ==> Result: 20 only appears once
Comment 4 Lucas Gass (lukeg) 2024-11-01 18:03:33 UTC
Created attachment 173887 [details] [review]
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 <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 5 Katrin Fischer 2024-11-07 16:33:33 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 6 Lucas Gass (lukeg) 2024-12-05 21:47:49 UTC
Backported to 24.05.x for upcoming 24.05.06
Comment 7 Fridolin Somers 2024-12-18 10:19:40 UTC
Pushed to 23.11.x for 23.11.11
Comment 8 Jesse Maseto 2025-02-03 16:33:11 UTC
Not pushed to LTS. Marked Resolved.

If you feel this should be in LTS please reply with your reason.