LP#1620750 Prevent log warning for uninit var in checkin_retarget()
authorDan Scott <dscott@laurentian.ca>
Tue, 6 Sep 2016 17:53:02 +0000 (13:53 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 28 Oct 2016 19:09:06 +0000 (15:09 -0400)
If the retarget_mode variable is not initialized, then a warning is generated
in the logs every time an item is checked in. Avoid the warning by
short-circuiting before testing the value in the regex.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm

index d142df6..8daab0c 100644 (file)
@@ -2229,7 +2229,7 @@ sub check_transit_checkin_interval {
 # Retarget local holds at checkin
 sub checkin_retarget {
     my $self = shift;
-    return unless $self->retarget_mode =~ m/retarget/; # Retargeting?
+    return unless $self->retarget_mode and $self->retarget_mode =~ m/retarget/; # Retargeting?
     return unless $self->is_checkin; # Renewals need not be checked
     return if $self->capture eq 'nocapture'; # Not capturing holds anyway? Move on.
     return if $self->is_precat; # No holds for precats