From f32451fcb18e61f301e7bb7b0af0c26810a2a783 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 16 Jun 2015 15:50:21 +0200 Subject: [PATCH] Bug 13540: Remove the too specific subroutine This patch replaces the too specific GetRealItemLocations subroutine with a call to GetItem --- C4/Items.pm | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index 3c3cff7..eab7ae7 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -959,22 +959,6 @@ sub GetItemLocation { return \%itemlocation; } -=head GetRealItemLocations - - my $locations = C4::Items::GetRealItemLocations($itemnumber); - -A convenience function of getting just the Item location and permanent_location -@PARAM1, Long, the koha-items.itemnumber -@RETURNS, Reference to Hash, with koha.items.location and permanent_location as hash keys. - -=cut -sub GetRealItemLocations { - my $itemnumber = shift; - my $sth = C4::Context->dbh()->prepare('SELECT location, permanent_location FROM items WHERE itemnumber = ?'); - $sth->execute($itemnumber); - return $sth->fetchrow_hashref(); -} - =head2 GetLostItems $items = GetLostItems( $where ); @@ -2071,8 +2055,7 @@ sub _do_column_fixes_for_mod { else { #Preserve the old permanent_location in face of adversity! #Don't let it fall to 'PROC' or 'CART'. Otherwise it will be forever lost! - my $locations = GetRealItemLocations( $item->{itemnumber} ); - $item->{'permanent_location'} = $locations->{'permanent_location'}; + $item->{'permanent_location'} = C4::Items::GetItem($item->{itemnumber})->{permanent_location}; } } if (exists $item->{'timestamp'}) { -- 2.1.0