Bug 23463: Replace _set_derived_columns_for_add

Remove the unique call to _set_derived_columns_for_add
Even if design to deal with other values it only dealts with cn_sort

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2019-03-18 14:20:51 -03:00 committed by Martin Renvoize
parent 02134d7604
commit 488a6f98a6
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
2 changed files with 11 additions and 2 deletions

View File

@ -202,7 +202,6 @@ sub AddItem {
$unlinked_item_subfields = shift;
}
_set_derived_columns_for_add($item);
$item->{'more_subfields_xml'} = _get_unlinked_subfields_xml($unlinked_item_subfields);
my ( $itemnumber, $error ) = _koha_new_item( $item, $item->{barcode} );

View File

@ -28,6 +28,8 @@ use Koha::DateUtils qw( dt_from_string );
use C4::Context;
use C4::Circulation;
use C4::Reserves;
use C4::ClassSource; # FIXME We would like to avoid that
use Koha::Checkouts;
use Koha::CirculationRules;
use Koha::Item::Transfer::Limits;
@ -67,8 +69,8 @@ sub store {
$self->itype($self->biblio->biblioitem->itemtype);
}
my $today = dt_from_string;
unless ( $self->in_storage ) { #AddItem
my $today = dt_from_string;
unless ( $self->permanent_location ) {
$self->permanent_location($self->location);
}
@ -79,6 +81,14 @@ sub store {
$self->datelastseen($today);
}
unless ( $self->dateaccessioned ) {
$self->dateaccessioned($today);
}
if ( $self->itemcallnumber ) { # This could be improved, we should recalculate it only if changed
my $cn_sort = GetClassSort($self->cn_source, $self->itemcallnumber, "");
$self->cn_sort($cn_sort);
}
}
unless ( $self->dateaccessioned ) {