Bugzilla – Attachment 86124 Details for
Bug 20537
Warnings in overdue_notices.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20537: Added check to remove warning from overdue_notices.pl
Bug-20537-Added-check-to-remove-warning-from-overd.patch (text/plain), 2.42 KB, created by
Hayley Pelham
on 2019-03-06 04:20:12 UTC
(
hide
)
Description:
Bug 20537: Added check to remove warning from overdue_notices.pl
Filename:
MIME Type:
Creator:
Hayley Pelham
Created:
2019-03-06 04:20:12 UTC
Size:
2.42 KB
patch
obsolete
>From 376d91bd70b8f688acb945068ee038768e01746d Mon Sep 17 00:00:00 2001 >From: Hayley Mapley <hayleymapley@catalyst.net.nz> >Date: Wed, 6 Mar 2019 04:15:53 +0000 >Subject: [PATCH] Bug 20537: Added check to remove warning from > overdue_notices.pl > >When executing overdue_notices.pl on borrowers that lack a surname, we >see this error: >Use of uninitialized value in concatenation (.) or string at >/usr/share/koha/bin/cronjobs/overdue_notices.pl line 575. > >This patch fixes this issue by setting the $borr variable >based on the information that has been defined. > >To test: >1) Create a borrower and set its surname to null >2) Checkout an item to the borrower and set it to be overdue >3) Navigate to kohaclone/misc/cronjobs and enter a koha-shell >4) Run the script: ./overdue_notices.pl >5) Observe the error appears >6) Apply the patch >7) Repeat steps 3-4 >8) Observe the error is gone >9) Sign off! >--- > misc/cronjobs/overdue_notices.pl | 22 +++++++++++++++++----- > 1 file changed, 17 insertions(+), 5 deletions(-) > >diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl >index 8c42335c2c..98652f3f71 100755 >--- a/misc/cronjobs/overdue_notices.pl >+++ b/misc/cronjobs/overdue_notices.pl >@@ -574,13 +574,25 @@ END_SQL > next; > } > $borrowernumber = $data->{'borrowernumber'}; >- my $borr = >- $data->{'firstname'} . ', ' >- . $data->{'surname'} . ' (' >- . $borrowernumber . ')'; >+ >+ my $borr; >+ if ($data->{'surname'} && $data->{'firstname'}) { >+ $borr = >+ $data->{'firstname'} . ', ' >+ . $data->{'surname'} . ' (' >+ . $borrowernumber . ')'; >+ } elsif ($data->{'surname'}) { >+ $borr = >+ $data->{'surname'} . ' (' >+ . $borrowernumber . ')'; >+ } elsif ($data->{'firstname'}) { >+ $borr = >+ $data->{'firstname'} . ' (' >+ . $borrowernumber . ')'; >+ } > $verbose > and warn "borrower $borr has items triggering level $i."; >- >+ > my $patron = Koha::Patrons->find( $borrowernumber ); > @emails_to_use = (); > my $notice_email = $patron->notice_email_address; >-- >2.11.0
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 20537
:
86124
|
89368
|
90085
|
90086