From a80039d531ddbadf4ec03ba8dc559bdff874d727 Mon Sep 17 00:00:00 2001 From: Kyle Hall Date: Thu, 9 Mar 2023 12:11:54 -0500 Subject: [PATCH] Bug 33184: Warnings when running holds queue builder If a hold was fillable when the holds queue builder starts, but is no longer fillable when the builder gets to that hold's record ( for example, an item was trapped to fill that hold so the hold is now "found" ), it will generate warnings like: Use of uninitialized value in addition (+) at /usr/share/koha/lib/C4/HoldsQueue.pm line 219. Use of uninitialized value in addition (+) at /usr/share/koha/lib/C4/HoldsQueue.pm line 220. Test Plan: 1) Run holds queue builder from the command line 2) While it is running fill a hold 3) Note the warning generated by build_holds_queue.pl 4) Apply this patch 5) Repeat steps 1-2 6) No warnings! --- C4/HoldsQueue.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm index 4df3af9dcf..38c32fc81f 100644 --- a/C4/HoldsQueue.pm +++ b/C4/HoldsQueue.pm @@ -896,7 +896,12 @@ are allowed to be passed to avoid calculating them many times inside loops. sub update_queue_for_biblio { my ($args) = @_; my $biblio_id = $args->{biblio_id}; - my $result; + + my $result = { + requests => 0, + available_items => 0, + mapped_items => 0, + }; # We need to empty the queue for this biblio unless CreateQueue has emptied the entire queue for rebuilding if ( $args->{delete} ) { -- 2.30.2