Bugzilla – Attachment 152492 Details for
Bug 34059
advance_notices.pl -c --digest-per-branch does not work as intended
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34059: Add only issues from the branch that is creating the notice
Bug-34059-Add-only-issues-from-the-branch-that-is-.patch (text/plain), 3.28 KB, created by
Sam Lau
on 2023-06-20 16:23:50 UTC
(
hide
)
Description:
Bug 34059: Add only issues from the branch that is creating the notice
Filename:
MIME Type:
Creator:
Sam Lau
Created:
2023-06-20 16:23:50 UTC
Size:
3.28 KB
patch
obsolete
>From 29ef3057b5f21727560058251f9bf2331c688213 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Mon, 19 Jun 2023 14:24:30 +0000 >Subject: [PATCH] Bug 34059: Add only issues from the branch that is creating > the notice > >Test plan, on k-t-d >1) Go to 'my account' on top right user menu >2) On 'Patron messaging preferences', click 'Edit' >3) On the 'Item due' row, check the 'Email' and 'Digests only' checkboxes and save >4) On the top search bar, press 'Check out' and enter '42' (koha user cardnumber) >5) On the checkout input bar, enter 39999000001372 and press checkout >7) Go to 'Set library' on top right user menu and pick a different library >8) Repeat step 4), then, on the checkout input, enter 39999000004571 and press checkout >9) Verify that this user now has 2 items checked out, from 2 different libraries at /cgi-bin/koha/circ/circulation.pl?borrowernumber=51 >9) Run the following 2 queries to force the due_date to be equal to 'today's' date for both issues: >NOTE: change the YYYY-MM-DD below to whatever day it is you're running this test plan > >UPDATE issues SET date_due = '2023-06-19 23:59:00' where issue_id = 1; >UPDATE issues SET date_due = '2023-06-19 23:59:00' where issue_id = 2; > >10) Run the cronjob: >./koha/misc/cronjobs/advance_notices.pl -c --digest-per-branch > >11) Verify that two DUEDGEST notices were created, one per each library, but both notices contain both issues: >SELECT letter_code, time_queued, content FROM message_queue ORDER BY message_id DESC LIMIT 2; > >12) Apply patch, then do 10) and 11) again >13) Verify that each notice only contains the issue for its respective library > >Signed-off-by: Sam Lau <samalau@gmail.com> >--- > misc/cronjobs/advance_notices.pl | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > >diff --git a/misc/cronjobs/advance_notices.pl b/misc/cronjobs/advance_notices.pl >index b0ccd6f1c3..d71cd348ec 100755 >--- a/misc/cronjobs/advance_notices.pl >+++ b/misc/cronjobs/advance_notices.pl >@@ -388,19 +388,19 @@ UPCOMINGITEM: foreach my $upcoming ( @$upcoming_dues ) { > > # Now, run through all the people that want digests and send them > >-my $sth_digest = $dbh->prepare(<<'END_SQL'); >-SELECT biblio.*, items.*, issues.* >+my $digest_query = 'SELECT biblio.*, items.*, issues.* > FROM issues,items,biblio > WHERE items.itemnumber=issues.itemnumber > AND biblio.biblionumber=items.biblionumber > AND issues.borrowernumber = ? >- AND (TO_DAYS(date_due)-TO_DAYS(NOW()) = ?) >-END_SQL >+ AND (TO_DAYS(date_due)-TO_DAYS(NOW()) = ?)'; >+ >+my $sth_digest = $dbh->prepare($digest_query); > > if ($digest_per_branch) { > while (my ($branchcode, $digests) = each %$upcoming_digest) { > send_digests({ >- sth => $sth_digest, >+ sth => $dbh->prepare( $digest_query . " AND issues.branchcode = '" . $branchcode . "'"), > digests => $digests, > letter_code => 'PREDUEDGST', > message_name => 'advance_notice', >@@ -418,7 +418,7 @@ if ($digest_per_branch) { > > while (my ($branchcode, $digests) = each %$due_digest) { > send_digests({ >- sth => $sth_digest, >+ sth => $dbh->prepare( $digest_query . " AND issues.branchcode = '" . $branchcode . "'" ), > digests => $digests, > letter_code => 'DUEDGST', > branchcode => $branchcode, >-- >2.30.2
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 34059
:
152475
|
152492
|
152522
|
154077