Bug 14576: Replaced calls using deprecated method GetItem with Koha::Items->find
authorHayley Mapley <hayleymapley@catalyst.net.nz>
Tue, 26 Mar 2019 23:16:20 +0000 (12:16 +1300)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 25 Apr 2019 11:36:24 +0000 (11:36 +0000)
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>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

C4/Items.pm
C4/Reserves.pm

index f4e2d14..69dc4d1 100644 (file)
@@ -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' );
index e2e08c7..f016fd0 100644 (file)
@@ -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 );
     }