From 516e76d1b53001a1be2f765e71d02b63ac9d85fb Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 6 Aug 2019 11:12:31 -0500 Subject: [PATCH] Bug 23463: _do_column_fixes_for_mod dealt with integer location and timestamp moved That's done in Koha::Item->store, and Koha::Object->store for integers. Signed-off-by: Tomas Cohen Arazi Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize --- C4/Items.pm | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index 36d1d92ba4..632110ce69 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -1270,52 +1270,6 @@ sub _set_derived_columns_for_add { } } -=head2 _do_column_fixes_for_mod - - _do_column_fixes_for_mod($item); - -Given an item hashref containing one or more -columns to modify, fix up certain values. -Specifically, set to 0 any passed value -of C, C, C, or -C that is either undefined or -contains the empty string. - -=cut - -sub _do_column_fixes_for_mod { - my $item = shift; - - if (exists $item->{'notforloan'} and - (not defined $item->{'notforloan'} or $item->{'notforloan'} eq '')) { - $item->{'notforloan'} = 0; - } - if (exists $item->{'damaged'} and - (not defined $item->{'damaged'} or $item->{'damaged'} eq '')) { - $item->{'damaged'} = 0; - } - if (exists $item->{'itemlost'} and - (not defined $item->{'itemlost'} or $item->{'itemlost'} eq '')) { - $item->{'itemlost'} = 0; - } - if (exists $item->{'withdrawn'} and - (not defined $item->{'withdrawn'} or $item->{'withdrawn'} eq '')) { - $item->{'withdrawn'} = 0; - } - if ( - exists $item->{location} - and ( !defined $item->{location} - || ( $item->{location} ne 'CART' and $item->{location} ne 'PROC' ) ) - and not $item->{permanent_location} - ) - { - $item->{'permanent_location'} = $item->{'location'}; - } - if (exists $item->{'timestamp'}) { - delete $item->{'timestamp'}; - } -} - =head2 _get_single_item_column _get_single_item_column($column, $itemnumber); -- 2.39.5