Bugzilla – Attachment 119330 Details for
Bug 17202
Deleting a rotating collection with items should either be prohibited or items should be removed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17202: Don't report an item in a collection if the collection doesn't exist
Bug-17202-Dont-report-an-item-in-a-collection-if-t.patch (text/plain), 2.41 KB, created by
Owen Leonard
on 2021-04-08 15:00:22 UTC
(
hide
)
Description:
Bug 17202: Don't report an item in a collection if the collection doesn't exist
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2021-04-08 15:00:22 UTC
Size:
2.41 KB
patch
obsolete
>From ea88898971194181a5f2ce693849470ea901578b Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 7 Apr 2021 13:56:56 +0000 >Subject: [PATCH] Bug 17202: Don't report an item in a collection if the > collection doesn't exist > >This simply adds a JOIN to the collections table - if the collection is gone >then the item is not considered to be in a rotating collection > >Also remove variable to store the return that is not used later > >To test: >Create a rotating collection >Add an item >Delete the rotating collection >View the db (SELECT * FROM collections_tracking;) >The item is still in the collection >Enable AutomaticItemReturn >Checkin the item at a branch not its home >The item does not get transferred home >Apply patch >Restart all the things >Check in the item, it is transferred home > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > C4/Circulation.pm | 3 +-- > C4/RotatingCollections.pm | 2 +- > 2 files changed, 2 insertions(+), 3 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 0585ebbf80..ff106e2931 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2166,7 +2166,6 @@ sub AddReturn { > my $transfer = $item->get_transfer; > > # if we have a transfer to complete, we update the line of transfers with the datearrived >- my $is_in_rotating_collection = C4::RotatingCollections::isItemInAnyCollection( $item->itemnumber ); > if ($transfer) { > $validTransfer = 0; > if ( $transfer->in_transit ) { >@@ -2278,7 +2277,7 @@ sub AddReturn { > } > > # Transfer to returnbranch if Automatic transfer set or append message NeedsTransfer >- if ( $validTransfer && !$is_in_rotating_collection >+ if ( $validTransfer && !C4::RotatingCollections::isItemInAnyCollection( $item->itemnumber ) > && ( $doreturn or $messages->{'NotIssued'} ) > and !$resfound > and ( $branch ne $returnbranch ) >diff --git a/C4/RotatingCollections.pm b/C4/RotatingCollections.pm >index 5ee1982123..2732a69b80 100644 >--- a/C4/RotatingCollections.pm >+++ b/C4/RotatingCollections.pm >@@ -571,7 +571,7 @@ sub isItemInAnyCollection { > my $dbh = C4::Context->dbh; > > my $sth = $dbh->prepare( >- "SELECT itemnumber FROM collections_tracking WHERE itemnumber = ?"); >+ "SELECT itemnumber FROM collections_tracking JOIN collections USING (colId) WHERE itemnumber = ?"); > $sth->execute($itemnumber) or return (0); > > my $row = $sth->fetchrow_hashref; >-- >2.11.0
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 17202
:
119306
|
119330
|
120099
|
120100
|
120216
|
120217
|
120218
|
120219