Bug 30397 - Duplicate '20' option in dropdown 'Show entries' menu
Summary: Duplicate '20' option in dropdown 'Show entries' menu
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Lucas Gass (lukeg)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-29 15:01 UTC by Séverine Queune
Modified: 2024-11-07 16:33 UTC (History)
5 users (show)

See Also:
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
Circulation function:


Attachments
Bug 30397: Remove duplicate entry from length menu of patrons search (1.41 KB, patch)
2024-10-31 13:42 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 30397: Remove duplicate entry from length menu of patrons search (1.46 KB, patch)
2024-10-31 21:47 UTC, David Nind
Details | Diff | Splinter Review
Bug 30397: Remove duplicate entry from length menu of patrons search (1.51 KB, patch)
2024-11-01 18:03 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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!