From 69881b545388ac0237e463781497ce0ad0328ddd 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. --- C4/Items.pm | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index 49e8e52be1..17790d7fb9 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -1267,52 +1267,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.25.0