From 23a12cf4d81c6ebcdba02f15f0f6424d75e6ce55 Mon Sep 17 00:00:00 2001 From: Hayley Mapley 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 Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- 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 e2e08c7775..f016fd024a 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.39.5