From 62b6d94daaea5e113260e8888c522a2697b745f2 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 20 Mar 2019 15:46:26 +0000 Subject: [PATCH] Bug 14576: Rebase fixes Fix test Rebase code Signed-off-by: Liz Rea Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- C4/Circulation.pm | 13 ++++++------- t/db_dependent/Circulation/issue.t | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index e744676653..dd913e6f04 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1428,7 +1428,6 @@ sub AddIssue { } )->store; } - if ( $item_object->location eq 'CART' && $item_object->permanent_location ne 'CART' ) { ## Item was moved to cart via UpdateItemLocationOnCheckin, anything issued should be taken off the cart. CartToShelf( $item_object->itemnumber ); @@ -1890,19 +1889,19 @@ sub AddReturn { map { $update_loc_rules->{$_} = $update_loc_rules->{$_}[0] } keys %$update_loc_rules; #We can only move to one location so we flatten the arrays if ($update_loc_rules) { if (defined $update_loc_rules->{_ALL_}) { - if ($update_loc_rules->{_ALL_} eq '_PERM_') { $update_loc_rules->{_ALL_} = $item->{permanent_location}; } + if ($update_loc_rules->{_ALL_} eq '_PERM_') { $update_loc_rules->{_ALL_} = $item->permanent_location; } if ($update_loc_rules->{_ALL_} eq '_BLANK_') { $update_loc_rules->{_ALL_} = ''; } - if ( $item->{location} ne $update_loc_rules->{_ALL_}) { - $messages->{'ItemLocationUpdated'} = { from => $item->{location}, to => $update_loc_rules->{_ALL_} }; + if ( $item->location ne $update_loc_rules->{_ALL_}) { + $messages->{'ItemLocationUpdated'} = { from => $item->location, to => $update_loc_rules->{_ALL_} }; ModItem( { location => $update_loc_rules->{_ALL_} }, undef, $itemnumber ); } } else { foreach my $key ( keys %$update_loc_rules ) { - if ( $update_loc_rules->{$key} eq '_PERM_' ) { $update_loc_rules->{$key} = $item->{permanent_location}; } + if ( $update_loc_rules->{$key} eq '_PERM_' ) { $update_loc_rules->{$key} = $item->permanent_location; } if ( $update_loc_rules->{$key} eq '_BLANK_') { $update_loc_rules->{$key} = '' ;} - if ( ($item->{location} eq $key && $item->{location} ne $update_loc_rules->{$key}) || ($key eq '_BLANK_' && $item->{location} eq '' && $update_loc_rules->{$key} ne '') ) { - $messages->{'ItemLocationUpdated'} = { from => $item->{location}, to => $update_loc_rules->{$key} }; + if ( ($item->location eq $key && $item->location ne $update_loc_rules->{$key}) || ($key eq '_BLANK_' && $item->location eq '' && $update_loc_rules->{$key} ne '') ) { + $messages->{'ItemLocationUpdated'} = { from => $item->location, to => $update_loc_rules->{$key} }; ModItem( { location => $update_loc_rules->{$key} }, undef, $itemnumber ); last; } diff --git a/t/db_dependent/Circulation/issue.t b/t/db_dependent/Circulation/issue.t index 31dd457252..e945876378 100644 --- a/t/db_dependent/Circulation/issue.t +++ b/t/db_dependent/Circulation/issue.t @@ -418,7 +418,7 @@ $item2 = Koha::Items->find( $itemnumber2 ); ok( $item2->location eq 'PROC' , q{UpdateItemLocationOnCheckin updates location value from '' to 'PROC' with setting "_BLANK_: PROC"} ); ok( $item2->permanent_location eq '' , q{UpdateItemLocationOnCheckin does not update permanent_location value from '' to 'PROC' with setting "_BLANK_: PROC"} ); AddReturn( 'barcode_4', $branchcode_1 ); -$item2 = Koha::Items( $itemnumber2 ); +$item2 = Koha::Items->find( $itemnumber2 ); ok( $item2->location eq '' , q{UpdateItemLocationOnCheckin updates location value from 'PROC' to '' with setting "PROC: _PERM_" } ); ok( $item2->permanent_location eq '' , q{UpdateItemLocationOnCheckin does not update permanent_location from '' with setting "PROC: _PERM_" } ); -- 2.39.5