Bugzilla – Attachment 186983 Details for
Bug 40886
Patron circ messages not sorted in chronological order
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40886: Ensure patron messages display in proper chronological order
Bug-40886-Ensure-patron-messages-display-in-proper.patch (text/plain), 2.65 KB, created by
Laura Escamilla
on 2025-09-26 15:42:12 UTC
(
hide
)
Description:
Bug 40886: Ensure patron messages display in proper chronological order
Filename:
MIME Type:
Creator:
Laura Escamilla
Created:
2025-09-26 15:42:12 UTC
Size:
2.65 KB
patch
obsolete
>From acc2c871452fb3297803355c1085135c963aa1cd Mon Sep 17 00:00:00 2001 >From: Laura_Escamilla <laura.escamilla@bywatersolutions.com> >Date: Fri, 26 Sep 2025 15:36:40 +0000 >Subject: [PATCH] Bug 40886: Ensure patron messages display in proper > chronological order > >1. Create several random patron circ messages with different dates. I used the following sql for my ktd: > -- INSERT INTO messages (borrowernumber, branchcode, message_type, message, message_date) >SELECT > 51 AS borrowernumber, > 'CPL' AS branchcode, > ELT(FLOOR(1 + (RAND() * 3)), 'L','B','E') AS message_type, -- L=Staff note, B=OPAC, E=Email (adjust to your codes) > CONCAT('Random test message ', FLOOR(RAND()*1000)) AS message, > DATE_ADD(CURDATE(), INTERVAL -FLOOR(RAND() * 1825) DAY) AS message_date -- random day in last ~5 years (5*365) >FROM ( > SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 > UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL SELECT 10 >) AS x; > >2. View the patron account and notice that messages are sorted by type, but not by date. >3. Apply the patch and restart_all >4. Refresh the patron account page and clear the browser cache if necessary. >5. View the patron account again and notice that the messages are still sorted by type, but they are also sorted in descending order (newest to oldest). >6. Sign off and have a great day! >--- > circ/circulation.pl | 2 +- > members/moremember.pl | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index caa743afa2..b933a578f5 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -739,7 +739,7 @@ if ($patron) { > join => 'manager', > '+select' => [ 'manager.surname', 'manager.firstname' ], > '+as' => [ 'manager_surname', 'manager_firstname' ], >- 'order_by' => { -desc => 'me.message_type' }, >+ 'order_by' => [ 'me.message_type', { -desc => 'me.message_date' }, { -desc => 'me.message_id' } ], > } > ); > $template->param( patron_messages => $patron_messages ); >diff --git a/members/moremember.pl b/members/moremember.pl >index dd05a28eac..9cf8574e10 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -189,7 +189,7 @@ my $patron_messages = Koha::Patron::Messages->search( > join => 'manager', > '+select' => [ 'manager.surname', 'manager.firstname' ], > '+as' => [ 'manager_surname', 'manager_firstname' ], >- 'order_by' => { -desc => 'me.message_type' }, >+ 'order_by' => [ 'me.message_type', { -desc => 'me.message_date' }, { -desc => 'me.message_id' } ], > } > ); > >-- >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 40886
: 186983