Bugzilla – Attachment 134833 Details for
Bug 30728
Allow real-time holds queue opt-out
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30728: Only trigger real-time holds queue update if enabled
Bug-30728-Only-trigger-real-time-holds-queue-updat.patch (text/plain), 6.51 KB, created by
David Nind
on 2022-05-10 20:24:50 UTC
(
hide
)
Description:
Bug 30728: Only trigger real-time holds queue update if enabled
Filename:
MIME Type:
Creator:
David Nind
Created:
2022-05-10 20:24:50 UTC
Size:
6.51 KB
patch
obsolete
>From 9d4945cc0f90c8ed43502a15407a1b80213ee57d Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 10 May 2022 14:18:55 -0300 >Subject: [PATCH] Bug 30728: Only trigger real-time holds queue update if > enabled > >This patch makes the places in which Koha enqueues holds queue for >real time updates verify the feature is enabled. > >To test: >1. Apply this patches up to the unit tests >2. Run: > $ updatedatabase > $ kshell > k$ git diff origin/master --name-only | grep -e '\.t$' | xargs prove >=> FAIL: tests fail, the code doesn't care about the syspref >3. Apply this patch >4. Repeat 2 >=> SUCCESS: Tests pass! >5. Be happy! >6. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: David Nind <david@davidnind.com> >--- > C4/Biblio.pm | 6 +++--- > C4/Circulation.pm | 4 ++-- > C4/Reserves.pm | 6 +++--- > Koha/BackgroundJob/BatchDeleteBiblio.pm | 2 +- > Koha/BackgroundJob/BatchDeleteItem.pm | 4 ++-- > Koha/Hold.pm | 8 ++++---- > Koha/Item.pm | 4 ++-- > 7 files changed, 17 insertions(+), 17 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index 36035feff7..f8e6b9bcd6 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -347,7 +347,7 @@ us to not relink records when the authority linker is saving modifications. > =item C<skip_holds_queue> > > Unless C<skip_holds_queue> is passed, ModBiblio will trigger the BatchUpdateBiblioHoldsQueue >-task to rebuild the holds queue for the biblio. >+task to rebuild the holds queue for the biblio if I<RealTimeHoldsQueue> is enabled. > > =back > >@@ -440,7 +440,7 @@ sub ModBiblio { > { > biblio_ids => [ $biblionumber ] > } >- ) unless $options->{skip_holds_queue}; >+ ) unless $options->{skip_holds_queue} or !C4::Context->preference('RealTimeHoldsQueue'); > > return 1; > } >@@ -547,7 +547,7 @@ sub DelBiblio { > { > biblio_ids => [ $biblionumber ] > } >- ) unless $params->{skip_holds_queue}; >+ ) unless $params->{skip_holds_queue} or !C4::Context->preference('RealTimeHoldsQueue'); > > return; > } >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index d312961478..117c4dd066 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1779,7 +1779,7 @@ sub AddIssue { > { > biblio_ids => [ $item_object->biblionumber ] > } >- ); >+ ) if C4::Context->preference('RealTimeHoldsQueue'); > } > } > return $issue; >@@ -2445,7 +2445,7 @@ sub AddReturn { > { > biblio_ids => [ $item->biblionumber ] > } >- ); >+ ) if C4::Context->preference('RealTimeHoldsQueue'); > } > > return ( $doreturn, $messages, $issue, ( $patron ? $patron->unblessed : {} )); >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 81fecaebe0..5193a5454c 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -319,7 +319,7 @@ sub AddReserve { > { > biblio_ids => [ $biblionumber ] > } >- ); >+ ) if C4::Context->preference('RealTimeHoldsQueue'); > > return $reserve_id; > } >@@ -1446,7 +1446,7 @@ sub AlterPriority { > { > biblio_ids => [ $hold->biblionumber ] > } >- ); >+ ) if C4::Context->preference('RealTimeHoldsQueue'); > # FIXME Should return the new priority > } > >@@ -2099,7 +2099,7 @@ sub RevertWaitingStatus { > { > biblio_ids => [ $hold->biblionumber ] > } >- ); >+ ) if C4::Context->preference('RealTimeHoldsQueue'); > > > return $hold; >diff --git a/Koha/BackgroundJob/BatchDeleteBiblio.pm b/Koha/BackgroundJob/BatchDeleteBiblio.pm >index d834f29b7c..b5984ce44f 100644 >--- a/Koha/BackgroundJob/BatchDeleteBiblio.pm >+++ b/Koha/BackgroundJob/BatchDeleteBiblio.pm >@@ -164,7 +164,7 @@ sub process { > { > biblio_ids => \@deleted_biblionumbers > } >- ); >+ ) if C4::Context->preference('RealTimeHoldsQueue'); > } > > my $job_data = decode_json $self->data; >diff --git a/Koha/BackgroundJob/BatchDeleteItem.pm b/Koha/BackgroundJob/BatchDeleteItem.pm >index 63e88142f1..57371289a9 100644 >--- a/Koha/BackgroundJob/BatchDeleteItem.pm >+++ b/Koha/BackgroundJob/BatchDeleteItem.pm >@@ -161,7 +161,7 @@ sub process { > { > biblio_ids => \@deleted_biblionumbers > } >- ); >+ ) if C4::Context->preference('RealTimeHoldsQueue'); > } > > if (@updated_biblionumbers) { >@@ -175,7 +175,7 @@ sub process { > { > biblio_ids => \@updated_biblionumbers > } >- ); >+ ) if C4::Context->preference('RealTimeHoldsQueue'); > } > } > ); >diff --git a/Koha/Hold.pm b/Koha/Hold.pm >index 97c6b4c37a..be5970cbd4 100644 >--- a/Koha/Hold.pm >+++ b/Koha/Hold.pm >@@ -130,7 +130,7 @@ sub suspend_hold { > { > biblio_ids => [ $self->biblionumber ] > } >- ); >+ ) if C4::Context->preference('RealTimeHoldsQueue'); > > return $self; > } >@@ -164,7 +164,7 @@ sub resume { > { > biblio_ids => [ $self->biblionumber ] > } >- ); >+ ) if C4::Context->preference('RealTimeHoldsQueue'); > > return $self; > } >@@ -627,7 +627,7 @@ sub cancel { > { > biblio_ids => [ $old_me->biblionumber ] > } >- ) unless $params->{skip_holds_queue}; >+ ) unless $params->{skip_holds_queue} or !C4::Context->preference('RealTimeHoldsQueue'); > } > ); > return $self; >@@ -697,7 +697,7 @@ sub fill { > { > biblio_ids => [ $old_me->biblionumber ] > } >- ); >+ ) if C4::Context->preference('RealTimeHoldsQueue'); > } > ); > return $self; >diff --git a/Koha/Item.pm b/Koha/Item.pm >index a6e3c1fa84..2cefac59be 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -217,7 +217,7 @@ sub store { > { > biblio_ids => [ $self->biblionumber ] > } >- ) unless $params->{skip_holds_queue}; >+ ) unless $params->{skip_holds_queue} or !C4::Context->preference('RealTimeHoldsQueue'); > > return $result; > } >@@ -248,7 +248,7 @@ sub delete { > { > biblio_ids => [ $self->biblionumber ] > } >- ) unless $params->{skip_holds_queue}; >+ ) unless $params->{skip_holds_queue} or !C4::Context->preference('RealTimeHoldsQueue'); > > return $result; > } >-- >2.30.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 30728
:
134823
|
134824
|
134825
|
134826
|
134827
|
134828
|
134829
|
134831
|
134832
|
134833
|
134834
|
134857
|
134858
|
134859
|
134860
|
134967