From a291cec32c5bdd7150375396dc2282b37722235d Mon Sep 17 00:00:00 2001
From: Hayley Mapley <hayleymapley@catalyst.net.nz>
Date: Wed, 27 Mar 2019 12:16:20 +1300
Subject: [PATCH] Bug 14576: Replaced calls using deprecated method GetItem
with Koha::Items->find
Test plan:
1) Apply all patches except this one
2) Checkout out an item to a patron
3) Check the item in - note that this will fail
4) Apply this patch, and repeat steps 1-3, noting instead that the the
check is instead successful
5) Verify also that reserves act as expected
5) Sign off
Sponsored-by: Catalyst IT
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
---
C4/Items.pm | 2 +-
C4/Reserves.pm | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/C4/Items.pm b/C4/Items.pm
index f4e2d140e1..69dc4d1f2b 100644
--- a/C4/Items.pm
+++ b/C4/Items.pm
@@ -546,7 +546,7 @@ sub ModItemTransfer {
my ( $itemnumber, $frombranch, $tobranch ) = @_;
my $dbh = C4::Context->dbh;
- my $item = GetItem( $itemnumber );
+ my $item = Koha::Items->find( $itemnumber );
# Remove the 'shelving cart' location status if it is being used.
CartToShelf( $itemnumber ) if ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART' );
diff --git a/C4/Reserves.pm b/C4/Reserves.pm
index b4e8e13069..a2156c10b0 100644
--- a/C4/Reserves.pm
+++ b/C4/Reserves.pm
@@ -1029,7 +1029,7 @@ sub ModReserveStatus {
my $sth_set = $dbh->prepare($query);
$sth_set->execute( $newstatus, $itemnumber );
- my $item = GetItem($itemnumber);
+ my $item = Koha::Items->find($itemnumber);
if ( ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART' ) && $newstatus ) {
CartToShelf( $itemnumber );
}
@@ -1082,7 +1082,7 @@ sub ModReserveAffect {
if ( !$transferToDo && !$already_on_shelf );
_FixPriority( { biblionumber => $biblionumber } );
- my $item = GetItem($itemnumber);
+ my $item = Koha::Items->find($itemnumber);
if ( ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART' ) ) {
CartToShelf( $itemnumber );
}
--
2.11.0