selection depth sometimes not properly calculated for holds
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
New
|
Undecided
|
Unassigned |
Bug Description
Consider a title-level hold request created open-ils.
Depending on various permutations of boundary settings, the depth returned by the possibility check (ultimately open-ils.
That in turn can get passed into the logic that later creates the action.hold_request row via lines like this:
$params-
However, there's a problem here: if $res->{'depth'} is 0, $params->{'depth'} is unchanged. If that key is missing, or contains an undef value, the selection_depth gets set to null.
Normally, ahr.selection_depth has a default value applied at the database layer in that case. In a stock system, that value is 0, but I've run across at least one system where that value was instead changed to 1.
IOW, depth = undef/NULL is not equivalent to depth = 0. $res->{'depth'} should be tested for existence and having a defined value, not just Perl truthiness.
Evergreen main
(I grant that this is a pretty obscure bug.)