From: Jeff Davis Date: Thu, 8 Apr 2021 02:41:49 +0000 (-0700) Subject: LP#1923076: ensure length of empty array is treated as a number when retrieving hold... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e6006d5a8e17a3158145561b2fbeb6638d6a5dad;p=evergreen%2Fpines.git LP#1923076: ensure length of empty array is treated as a number when retrieving hold counts Thanks to Jason Stephenson for suggesting this solution. Signed-off-by: Jeff Davis Signed-off-by: Jason Stephenson Signed-off-by: Michele Morgan Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm index 72251e4841..0faeea2c7a 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm @@ -2232,17 +2232,17 @@ sub hold_request_count { my $resp = { total => scalar(@$holds), - ready => scalar(@ready) + ready => int(scalar(@ready)) }; if ($ctx_org) { # count of holds ready at pickup lib with behind_desk true. - $resp->{behind_desk} = scalar( + $resp->{behind_desk} = int(scalar( grep { $_->{pickup_lib} == $ctx_org and $U->is_true($_->{behind_desk}) } @ready - ); + )); } return $resp;