From 363ce2cde9e5521b0fc30c392dcc8d120e2260ac Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Tue, 1 Aug 2017 14:10:56 +0200 Subject: [PATCH] Bug 18996: Resolve an uninitialized warning from ILS/Item.pm From the syslog call on line 107/108. The field $item->{title} has not been initialized. When catching the warns in a test script with Test::Warn, I got: Use of uninitialized value $args[1] in sprintf at /usr/lib/x86_64-linux-gnu/perl/5.20/Sys/Syslog.pm line 423. This simply resolves the warning. We might have a closer look to this title field on another report though. Test plan: Run Message.t from the next patch without this fix. It will fail since the additional warning makes warnings_like return false. Signed-off-by: Marcel de Rooy Signed-off-by: Colin Campbell Signed-off-by: Kyle M Hall --- C4/SIP/ILS/Item.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/SIP/ILS/Item.pm b/C4/SIP/ILS/Item.pm index 12bf1aa..4e5441f 100644 --- a/C4/SIP/ILS/Item.pm +++ b/C4/SIP/ILS/Item.pm @@ -105,7 +105,7 @@ sub new { bless $self, $type; syslog("LOG_DEBUG", "new ILS::Item('%s'): found with title '%s'", - $item_id, $self->{title}); + $item_id, $self->{title}//'' ); return $self; } -- 2.10.2