From e6d255b5e50b141caec6aad60f5dd440ba4af02f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 20 Mar 2020 15:15:17 +0100 Subject: [PATCH] Bug 23463: Fix items.cn_sort vs cn_sort Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize --- C4/Items.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/C4/Items.pm b/C4/Items.pm index e56dec8640..a2cd03b3c9 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -160,6 +160,7 @@ sub AddItemFromMarc { $item_values->{more_subfields_xml} = _get_unlinked_subfields_xml($unlinked_item_subfields); $item_values->{biblionumber} = $biblionumber; $item_values->{cn_source} = delete $item_values->{'items.cn_source'}; # Because of C4::Biblio::_disambiguate + $item_values->{cn_sort} = delete $item_values->{'items.cn_sort'}; # Because of C4::Biblio::_disambiguate my $item = Koha::Item->new( $item_values )->store; return ( $item->biblionumber, $item->biblioitemnumber, $item->itemnumber ); } @@ -239,6 +240,7 @@ sub AddItemBatchFromMarc { $item->{'biblionumber'} = $biblionumber; $item->{'biblioitemnumber'} = $biblioitemnumber; $item->{cn_source} = delete $item->{'items.cn_source'}; # Because of C4::Biblio::_disambiguate + $item->{cn_sort} = delete $item->{'items.cn_sort'}; # Because of C4::Biblio::_disambiguate # check for duplicate barcode my %item_errors = CheckItemPreSave($item); @@ -281,6 +283,7 @@ sub ModItemFromMarc { my $item_object = Koha::Items->find($itemnumber); my $item = TransformMarcToKoha( $localitemmarc, $frameworkcode, 'items' ); $item->{cn_source} = delete $item->{'items.cn_source'}; # Because of C4::Biblio::_disambiguate + $item->{cn_sort} = delete $item->{'items.cn_sort'}; # Because of C4::Biblio::_disambiguate $item->{itemnumber} = $itemnumber; $item->{biblionumber} = $biblionumber; $item_object = $item_object->set_or_blank($item); -- 2.39.5