From 836518bac79125a239b69710eb571abd3cfebf85 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 11 Apr 2022 17:20:11 +0100 Subject: [PATCH] Bug 29346: Highlight double enqueue This patch highlights a possible issue with the triggers.. though it may not actually matter in reality. I appear to already see test failures before this patch with a double enqueue of the rebuild for both AddIssue and AddReturn.. I couldn't spot what was causing that but whilst digging I did find another case where it could happen as highlighted here... Signed-off-by: Tomas Cohen Arazi --- t/db_dependent/Circulation_holdsqueue.t | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Circulation_holdsqueue.t b/t/db_dependent/Circulation_holdsqueue.t index f8a82ffd199..45b5a731d64 100755 --- a/t/db_dependent/Circulation_holdsqueue.t +++ b/t/db_dependent/Circulation_holdsqueue.t @@ -41,16 +41,18 @@ subtest 'AddIssue() and AddReturn() real-time holds queue tests' => sub { my $item = $builder->build_sample_item({ library => $library->id }); t::lib::Mocks::mock_userenv({ branchcode => $library->id }); + t::lib::Mocks::mock_preference( 'UpdateTotalIssuesOnCirc', 1 ); my $action; my $mock = Test::MockModule->new('Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue'); $mock->mock( 'enqueue', sub { my ( $self, $args ) = @_; + my ($package, $filename, $line) = caller; is_deeply( $args->{biblio_ids}, [ $item->biblionumber ], - "$action triggers a holds queue update for the related biblio" + "$action triggers a holds queue update for the related biblio from $package" ); } ); -- 2.36.0