Log Noise - uninitialized value warnings - holds depth

Bug #1667497 reported by Josh Stompro on 2017-02-23
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Medium
Unassigned
3.1
Medium
Unassigned
3.2
Medium
Unassigned

Bug Description

EG 2.10.6

We see a number of warnings like the following every day, 298 in 6 hours.

298 ] open-ils.circ.title_hold.is_possible: Use of uninitialized value $depth in numeric eq (==) at /usr/local/share/perl/5.20.2/OpenILS/Application/Circ/Holds.pm line 2551.

Line looks like
return () if $depth == $top_org->ou_type->depth;

We don't use any depth settings, so maybe that statement should return if $depth isn't defined or it equals $top_org->ou_type->depth?

Josh

Working branch at
user/stompro/lp1667497_set_depth_undefied_log_noise
https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/stompro/lp1667497_set_depth_undefied_log_noise

It just sets $params{depth} to $depth, so it gets set to 0 if not defined.

There is already a comment about this issue.

# FIXME: better params checking. what other params are required, if any?
# FIXME: 3 copies of values confusing: $x, $params->{x} and $params{x}
# FIXME: for example, $depth gets a default value, but then $$params{depth} is still
# used in conditionals, where it may be undefined, causing a warning.
# FIXME: specify proper usage/interaction of selection_ou and pickup_lib

Another solution would be to not use $params{depth} further down, but $depth seems like it might get changed before that, so maybe that is why it is used? This seemed like the simplest change to me.

Josh

tags: added: pullrequest
Changed in evergreen:
assignee: nobody → Jason Stephenson (jstephenson)
status: New → Confirmed
importance: Undecided → Medium
milestone: none → 3.3-rc
Jason Stephenson (jstephenson) wrote :

Looks like a simple way to fix it, and it works for me. I tried a few holds and the message didn't show up, hold boundaries still worked when I tried it.

Pushed to master, rel_3_1, and rel_3_2.

Thanks, Josh!

Changed in evergreen:
assignee: Jason Stephenson (jstephenson) → nobody
status: Confirmed → Fix Committed
tags: added: signedoff
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers