From e98a11859eb7d18bfab333f82789fb78339adb12 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Tue, 17 Apr 2018 23:59:58 +0000 Subject: [PATCH] Bug 20592: Checks for itemnumber sooner Two lines of code and move them earlier. Add a check to make sure there are changes. Followed the test plan, both the _BEFORE_ and after do as described. Signed-off-by: Cori Lynn Arnold --- C4/Items.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index 926879ee4f..f81e0ca1b8 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -543,6 +543,9 @@ sub ModItem { my $log_action = $additional_params->{log_action} // 1; my $unlinked_item_subfields = $additional_params->{unlinked_item_subfields}; + return unless %$item; + $item->{'itemnumber'} = $itemnumber or return; + # if $biblionumber is undefined, get it from the current item unless (defined $biblionumber) { $biblionumber = _get_single_item_column('biblionumber', $itemnumber); @@ -552,8 +555,6 @@ sub ModItem { $item->{'more_subfields_xml'} = _get_unlinked_subfields_xml($unlinked_item_subfields); }; - $item->{'itemnumber'} = $itemnumber or return; - my @fields = qw( itemlost withdrawn damaged ); # Only call GetItem if we need to set an "on" date field -- 2.11.0