open-ils.circ.checkin generates a WARN log message in checkin_retarget()

Bug #1620750 reported by Dan Scott
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Low
Unassigned
2.10
Fix Released
Low
Unassigned
2.11
Fix Released
Low
Unassigned

Bug Description

* Evergreen 2.10.6

Every invocation of open-ils.circ.checkin prompts a warning due to the use of an uninitialized var in a regex, like so:

Sep 6 17:24:17 cprod2 osrf_json_gw: [ACT:26504:./osrf_json_gateway.c:328:1473182559265046] [142.51.8.82] [blah] [en-US] open-ils.circ open-ils.circ.checkin "blah", {"barcode":"123456789"}
Sep 6 17:24:17 cprod2 open-ils.circ: [WARN:21284:Application.pm:590:1473182559265046] open-ils.circ.checkin: Use of uninitialized value in pattern match (m//) at /usr/local/share/perl/5.18.2/OpenILS/Application/Circ/Circulate.pm line 2226.

The offending code is at:

# Retarget local holds at checkin
sub checkin_retarget {
    my $self = shift;
    return unless $self->retarget_mode =~ m/retarget/; # Retargeting?

Proposed solution is to add a guard to the clause, like "return unless $self->retarget_mode and $self->retarget_mode ...". Same problem exists in master. Patch forthcoming.

Dan Scott (denials)
description: updated
Revision history for this message
Dan Scott (denials) wrote :

Commit is at http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/dbs/lp1620750_uninit_var_checkin_retarget - tested on master and confirmed that the uninit warning no longer appears when no retarget mode has been selected.

tags: added: pullrequest
Revision history for this message
Chris Sharp (chrissharp123) wrote :
tags: added: signedoff
removed: pullrequest
Changed in evergreen:
importance: Undecided → Low
status: New → Confirmed
tags: added: pullrequest
Revision history for this message
Galen Charlton (gmc) wrote :

Pushed all the way through rel_2_10. Thanks, Dan and Chris!

Changed in evergreen:
status: Confirmed → Fix Committed
Changed in evergreen:
milestone: 2.next → 2.11.1
milestone: 2.11.1 → 2.next
Changed in evergreen:
milestone: 2.next → 2.12-beta
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.