Bug 27526: Fix 'duplicate item'

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2021-10-13 09:29:12 +02:00
parent 81ee4a0e2f
commit e8d9c0e1a7
1 changed files with 3 additions and 3 deletions

View File

@ -632,14 +632,14 @@ if ($op eq "additem") {
} elsif ($op eq "dupeitem") {
#-------------------------------------------------------------------------------
# retrieve item if exist => then, it's a modif
my $item = Koha::Items->find($itemnumber);
$current_item = Koha::Items->find($itemnumber)->unblessed;
# FIXME Handle non existent item
if (C4::Context->preference('autoBarcode') eq 'incremental') {
my ( $barcode ) = C4::Barcodes::ValueBuilder::incremental::get_barcode;
$item->barcode($barcode);
$current_item->{barcode} = $barcode;
}
else {
$item->barcode(undef); # Don't save it!
$current_item->{barcode} = undef; # Don't save it!
}
$nextop = "additem";