From: Hayley Mapley Date: Tue, 26 Mar 2019 23:16:20 +0000 (+1300) Subject: Bug 14576: Replaced calls using deprecated method GetItem with Koha::Items->find X-Git-Tag: v19.05.00~284 X-Git-Url: http://git.equinoxoli.org/?p=koha.git;a=commitdiff_plain;h=23a12cf4d81c6ebcdba02f15f0f6424d75e6ce55 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 --- diff --git a/C4/Items.pm b/C4/Items.pm index f4e2d14..69dc4d1 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 e2e08c7..f016fd0 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 ); }