From 837c215477cfa170a7831fc85c77a27a002c835e Mon Sep 17 00:00:00 2001 From: Emily Lamancusa Date: Thu, 3 Aug 2023 10:28:30 -0400 Subject: [PATCH] Bug 34470: [DO NOT PUSH] Add logging to watch randomization --- C4/HoldsQueue.pm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm index 4b811627eb..a78ea7482a 100644 --- a/C4/HoldsQueue.pm +++ b/C4/HoldsQueue.pm @@ -33,6 +33,13 @@ use Koha::Patrons; use List::Util qw( shuffle ); use List::MoreUtils qw( any ); +use Data::Dumper; +use Koha::Logger; + +$Data::Dumper::Maxdepth = 2; +C4::Context->interface('intranet'); +my $logger = Koha::Logger->get(); + our (@ISA, @EXPORT_OK); BEGIN { require Exporter; @@ -813,8 +820,12 @@ sub load_branches_to_pull_from { ->get_column('branchcode')->all() unless (@branches_to_use); - @branches_to_use = shuffle(@branches_to_use) - if C4::Context->preference("RandomizeHoldsQueueWeight"); + if(C4::Context->preference("RandomizeHoldsQueueWeight")) { + $logger->warn("Branch list before shuffle:" . Dumper(@branches_to_use)); + @branches_to_use = shuffle(@branches_to_use); + $logger->warn("Branch list after shuffle:" . Dumper(@branches_to_use)); + } + my $today = dt_from_string(); if ( C4::Context->preference('HoldsQueueSkipClosed') ) { -- 2.34.1