Bugzilla – Attachment 165398 Details for
Bug 35979
Possible RealTimeHoldsQueue check missing in modrequest.pl for BatchUpdateBiblioHoldsQueue background job
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35979: (follow-up) Add check in ->enqueue
Bug-35979-follow-up-Add-check-in--enqueue.patch (text/plain), 2.24 KB, created by
Pedro Amorim
on 2024-04-23 13:25:51 UTC
(
hide
)
Description:
Bug 35979: (follow-up) Add check in ->enqueue
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-04-23 13:25:51 UTC
Size:
2.24 KB
patch
obsolete
>From 8c79f6026da7ef931a9c8f91a5721c43efa2bb34 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Tue, 23 Apr 2024 12:47:11 +0000 >Subject: [PATCH] Bug 35979: (follow-up) Add check in ->enqueue > >Foundation for removing same check elsewhere (later on). > >Test plan: >Run t/db_dependent/Koha/BackgroundJob/BatchUpdateBiblioHoldsQueue.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >PA amended: Fix bug # in commit message > >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >--- > Koha/BackgroundJob/BatchUpdateBiblioHoldsQueue.pm | 2 ++ > .../Koha/BackgroundJob/BatchUpdateBiblioHoldsQueue.t | 9 ++++++++- > 2 files changed, 10 insertions(+), 1 deletion(-) > >diff --git a/Koha/BackgroundJob/BatchUpdateBiblioHoldsQueue.pm b/Koha/BackgroundJob/BatchUpdateBiblioHoldsQueue.pm >index 6419435d414..4c64a61d1a7 100644 >--- a/Koha/BackgroundJob/BatchUpdateBiblioHoldsQueue.pm >+++ b/Koha/BackgroundJob/BatchUpdateBiblioHoldsQueue.pm >@@ -129,6 +129,8 @@ Enqueue the new job > sub enqueue { > my ( $self, $args ) = @_; > >+ return if !C4::Context->preference('RealTimeHoldsQueue'); #TODO Remove check from callers >+ > Koha::Exceptions::MissingParameter->throw( > "Missing biblio_ids parameter is mandatory") > unless exists $args->{biblio_ids}; >diff --git a/t/db_dependent/Koha/BackgroundJob/BatchUpdateBiblioHoldsQueue.t b/t/db_dependent/Koha/BackgroundJob/BatchUpdateBiblioHoldsQueue.t >index 17e948ae9b3..f4f3f204405 100755 >--- a/t/db_dependent/Koha/BackgroundJob/BatchUpdateBiblioHoldsQueue.t >+++ b/t/db_dependent/Koha/BackgroundJob/BatchUpdateBiblioHoldsQueue.t >@@ -32,12 +32,19 @@ my $builder = t::lib::TestBuilder->new; > > subtest 'enqueue() tests' => sub { > >- plan tests => 5; >+ plan tests => 6; > > $schema->storage->txn_begin; > > my $biblio_ids = [ 1, 2 ]; > >+ t::lib::Mocks::mock_preference( 'RealTimeHoldsQueue', 0 ); >+ is( >+ Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue( { biblio_ids => $biblio_ids } ), >+ undef, 'No result when pref is off' >+ ); >+ t::lib::Mocks::mock_preference( 'RealTimeHoldsQueue', 1 ); >+ > throws_ok > { Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue() } > 'Koha::Exceptions::MissingParameter', >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35979
:
165380
|
165385
|
165395
|
165396
|
165397
| 165398