[Bug 24072] New: Typos in advance_notices.pl causes DUEDGST not to be sent
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24072 Bug ID: 24072 Summary: Typos in advance_notices.pl causes DUEDGST not to be sent Change sponsored?: --- Product: Koha Version: 18.11 Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Notices Assignee: magnus@libriotech.no Reporter: magnus@libriotech.no QA Contact: testopia@bugs.koha-community.org In misc/cronjobs/advance_notices.pl we have this code: 372 if ($digest_per_branch) { 373 while (my ($branchcode, $digests) = each %$upcoming_digest) { 374 send_digests({ 375 sth => $sth_digest, 376 digests => $digests, 377 letter_code => 'PREDUEDGST', 378 branchcode => $branchcode, 379 get_item_info => sub { 380 my $params = shift; 381 $params->{sth}->execute($params->{borrowernumber}, 382 $params->{borrower_preferences}->{'days_in_advance'}); 383 return sub { 384 $params->{sth}->fetchrow_hashref; 385 }; 386 } 387 }); 388 } 389 390 while (my ($branchcode, $digests) = each %$due_digest) { 391 send_digests({ 392 sth => $sth_digest, 393 digest => $due_digest, ### HERE! 394 letter_code => 'DUEDGST', 395 branchcode => $branchcode, 396 get_item_info => sub { 397 my $params = shift; 398 $params->{sth}->execute($params->{borrowernumber}, 0); 399 return sub { 400 $params->{sth}->fetchrow_hashref; 401 }; 402 } 403 }); 404 } 405 } else { 406 send_digests({ 407 sth => $sth_digest, 408 digests => $upcoming_digest, 409 letter_code => 'PREDUEDGST', 410 get_item_info => sub { 411 my $params = shift; 412 $params->{sth}->execute($params->{borrowernumber}, 413 $params->{borrower_preferences}->{'days_in_advance'}); 414 return sub { 415 $params->{sth}->fetchrow_hashref; 416 }; 417 } 418 }); 419 420 send_digests({ 421 sth => $sth_digest, 422 digest => $due_digest, ### AND HERE! 423 letter_code => 'DUEDGST', 424 get_item_info => sub { 425 my $params = shift; 426 $params->{sth}->execute($params->{borrowernumber}, 0); 427 return sub { 428 $params->{sth}->fetchrow_hashref; 429 }; 430 } 431 }); 432 } A typo has crept in on lines 393 and 422, where "digest" should be written "digests", in the same way as it is done in the other two blocks of code. In send_digests() the incoming data is iterated over in this line: 531 PATRON: while ( my ( $borrowernumber, $digest ) = each %{$params->{digests}} ) { but when the data is actually in $params->{digest} they are not found and no DUEDGST messages are queued. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24072 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24072 --- Comment #1 from Magnus Enger <magnus@libriotech.no> --- Created attachment 95617 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95617&action=edit Bug 24072 - Typos in advance_notices.pl causes DUEDGST not to be sent There are two typos in advance_notics.pl that cause DUEDGST messages not to be sent. See Bugzilla for full details. If you think the typo is sufficiently obvious, you can just eyeball the patch and sign off, methinks. Otherwise, testing can be done something like this: - Make sure you have enabled enhanced messaging preferences, and a patron with "Email" and "Digests only" set for "Item due" messages - Issue an item to this patron, with due date today - Run something like this to generate advance notices: $ sudo koha-shell -c "perl \ /home/vagrant/kohaclone/misc/cronjobs/advance_notices.pl -n -c" kohadev - See that no notices are shown (-n means messages will go to stdout, instead of into the message queue). - Apply the patch and run advance_notices.pl again, as before. A DUEDGST message should now be displayed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24072 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #95617|0 |1 is obsolete| | --- Comment #2 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 95697 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95697&action=edit Bug 24072 - Typos in advance_notices.pl causes DUEDGST not to be sent There are two typos in advance_notics.pl that cause DUEDGST messages not to be sent. See Bugzilla for full details. If you think the typo is sufficiently obvious, you can just eyeball the patch and sign off, methinks. Otherwise, testing can be done something like this: - Make sure you have enabled enhanced messaging preferences, and a patron with "Email" and "Digests only" set for "Item due" messages - Issue an item to this patron, with due date today - Run something like this to generate advance notices: $ sudo koha-shell -c "perl \ /home/vagrant/kohaclone/misc/cronjobs/advance_notices.pl -n -c" kohadev - See that no notices are shown (-n means messages will go to stdout, instead of into the message queue). - Apply the patch and run advance_notices.pl again, as before. A DUEDGST message should now be displayed. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24072 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|Needs Signoff |Signed Off --- Comment #3 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Trivial patch, works, Signing off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24072 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_19_11_candidate -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24072 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24072 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #95697|0 |1 is obsolete| | --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 95754 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95754&action=edit Bug 24072 - Typos in advance_notices.pl causes DUEDGST not to be sent There are two typos in advance_notics.pl that cause DUEDGST messages not to be sent. See Bugzilla for full details. If you think the typo is sufficiently obvious, you can just eyeball the patch and sign off, methinks. Otherwise, testing can be done something like this: - Make sure you have enabled enhanced messaging preferences, and a patron with "Email" and "Digests only" set for "Item due" messages - Issue an item to this patron, with due date today - Run something like this to generate advance notices: $ sudo koha-shell -c "perl \ /home/vagrant/kohaclone/misc/cronjobs/advance_notices.pl -n -c" kohadev - See that no notices are shown (-n means messages will go to stdout, instead of into the message queue). - Apply the patch and run advance_notices.pl again, as before. A DUEDGST message should now be displayed. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24072 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Is 18.11 the right version here? It looks like send_digests was introduced later. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24072 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|18.11 |master --- Comment #6 from Magnus Enger <magnus@libriotech.no> --- (In reply to Katrin Fischer from comment #5)
Is 18.11 the right version here? It looks like send_digests was introduced later.
You are right, of course. It is relevant to master and 19.05. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24072 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |19.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24072 --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work! Pushed to master for 19.11.00 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24072 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_19_11_candidate | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24072 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable CC| |lucas@bywatersolutions.com --- Comment #8 from Lucas Gass <lucas@bywatersolutions.com> --- backported to 19.05.x for 19.05.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24072 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org