Bugzilla – Attachment 188402 Details for
Bug 41074
Last patron links are shuffled and wrong patrons removed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41074: Don't reverse previous_patrons arrary
Bug-41074-Dont-reverse-previouspatrons-arrary.patch (text/plain), 2.14 KB, created by
Marcel de Rooy
on 2025-10-24 07:50:05 UTC
(
hide
)
Description:
Bug 41074: Don't reverse previous_patrons arrary
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2025-10-24 07:50:05 UTC
Size:
2.14 KB
patch
obsolete
>From 78dfdbfffeddeb96a88940de253c738df8a751b0 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 22 Oct 2025 18:00:33 +0000 >Subject: [PATCH] Bug 41074: Don't reverse previous_patrons arrary >Content-Type: text/plain; charset=utf-8 > >This patch alters the code to append instead of prepend, removing the need to reverse the list > >To test: >1 - Write a report to get some patron >SELECT cardnumber,surname FROM borrowers WHERE cardnumber <>'' ORDER BY rand() LIMit 6 >2 - Enabled 'showLastPatron' and set count to 3 > http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=showLastPatron >3 - Copy the barcodes in order from the report and search for them in patron search, you'll want two tabs so you can keep report open >4 - Notice at 4th patron that list order has changed >5 - When 5th patron is loaded, the 4th is removed from the list >6 - Apply patch >7 - Clear the list >8 - Repeat the test plan, but note that list order does not change >9 - Confirm the patrons are removed from the list in expected order when adding new >10 - Change the count to 1 and search for several patrons, ensuring the last patron link is always correct > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >index ed6f0b35f7..29a1f3b064 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >@@ -256,11 +256,10 @@ $(document).ready(function () { > ); > $("#lastborrower-window").css("display", "inline-flex"); > >- previous_patrons.reverse(); > for (i in previous_patrons) { > p = previous_patrons[i]; > const el = `<li><a class="dropdown-item" href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=${p["borrowernumber"]}">${p["name"]} (${p["card"]})</a></li>`; >- $("#lastBorrowerList").prepend(el); >+ $("#lastBorrowerList").append(el); > } > } > >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 41074
:
188301
| 188402