From f22bded52404114572988e445e1ca0398fa3227d Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 18 Jun 2020 09:01:36 -0400 Subject: [PATCH] Bug 25805: Return empty strings instead of undef in C4::SIP::ILS::Item::hold_patron_name This bug is basically the same as bug 24966, but for hold_patron_name instead of hold_patron_bcode. The subroutine hold_patron_bcode should always return an empty string, not undef. Test Plan: 1) Using the SIP cli emulator, checkin an item that is not checked out 2) Note the DA field contains someting like "C4::SIP::SIPServer=HASH(0x88175c8)" The hex number will almost certainly be different from this example 3) Apply this patch 4) Restart the SIP server 5) Run the SIP checkin again 6) Note the DA field is no longer present! Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart (cherry picked from commit 017b67e6c52ab7b79a0187b1ca9fea220117f7ef) Signed-off-by: Lucas Gass (cherry picked from commit 18faf9b7aa7c313fd9fa086c5f9609ef7b0c70f5) Signed-off-by: Aleisha Amohia --- C4/SIP/ILS/Item.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/C4/SIP/ILS/Item.pm b/C4/SIP/ILS/Item.pm index 49f1f7bbb1..15e226d0c5 100644 --- a/C4/SIP/ILS/Item.pm +++ b/C4/SIP/ILS/Item.pm @@ -167,7 +167,7 @@ sub hold_patron_id { } sub hold_patron_name { my ( $self, $template ) = @_; - my $borrowernumber = $self->hold_patron_id() or return; + my $borrowernumber = $self->hold_patron_id() or return q{}; if ($template) { my $tt = Template->new(); @@ -181,8 +181,8 @@ sub hold_patron_name { my $holder = Koha::Patrons->find( $borrowernumber ); unless ($holder) { - syslog("LOG_ERR", "While checking hold, failed to retrieve the patron with borrowernumber '$borrowernumber'"); - return; + siplog("LOG_ERR", "While checking hold, failed to retrieve the patron with borrowernumber '$borrowernumber'"); + return q{}; } my $email = $holder->email || ''; my $phone = $holder->phone || ''; -- 2.20.1