From e6006d5a8e17a3158145561b2fbeb6638d6a5dad Mon Sep 17 00:00:00 2001 From: Jeff Davis Date: Wed, 7 Apr 2021 19:41:49 -0700 Subject: [PATCH] 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 --- Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; -- 2.11.0