Bugzilla – Attachment 144850 Details for
Bug 32529
Holds in processing should block item deletion
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32529: Make Koha::Item->safe_to_delete consider 'P' holds as found
Bug-32529-Make-KohaItem-safetodelete-consider-P-ho.patch (text/plain), 1.29 KB, created by
Nick Clemens (kidclamp)
on 2022-12-27 13:08:51 UTC
(
hide
)
Description:
Bug 32529: Make Koha::Item->safe_to_delete consider 'P' holds as found
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-12-27 13:08:51 UTC
Size:
1.29 KB
patch
obsolete
>From a3f468fc155235f1d9a8437490988ddc1665c305 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 26 Dec 2022 15:27:02 -0300 >Subject: [PATCH] Bug 32529: Make Koha::Item->safe_to_delete consider 'P' holds > as found > >Currently, the Koha::Item->safe_to_delete method checks (among other things) if there are existing waiting or in-transit holds. > >It seems that 'In processing' should block item deletion as well. > >This patch implements that. > >To test: >1. Apply up to the regression tests >2. Run: > $ kshell > k$ prove t/db_dependent/Koha/Item.t >=> FAIL: Boo! Tests fail! >3. Apply this patch >4. Repeat 2 >=> SUCCESS: Tests pass! >5. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/Item.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index e508e7eb55..1174519483 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -301,7 +301,7 @@ sub safe_to_delete { > > # check it doesn't have a waiting reserve > $error = "book_reserved" >- if $self->holds->search( { found => [ 'W', 'T' ] } )->count; >+ if $self->holds->filter_by_found->count; > > $error = "linked_analytics" > if C4::Items::GetAnalyticsCount( $self->itemnumber ) > 0; >-- >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 32529
:
144839
|
144840
|
144841
|
144848
|
144849
|
144850
|
144874
|
144875
|
144876