View | Details | Raw Unified | Return to bug 32418
Collapse All | Expand All

(-)a/cataloguing/additem.pl (-6 / +4 lines)
Lines 462-476 if ($op eq "additem") { Link Here
462
} elsif ($op eq "edititem") {
462
} elsif ($op eq "edititem") {
463
#-------------------------------------------------------------------------------
463
#-------------------------------------------------------------------------------
464
# retrieve item if exist => then, it's a modif
464
# retrieve item if exist => then, it's a modif
465
    $current_item = Koha::Items->find($itemnumber)->unblessed;
465
    $current_item = Koha::Items->find($itemnumber)->unblessed or undef;
466
    # FIXME Handle non existent item
466
    $nextop = $current_item ? "saveitem" : "additem";
467
    $nextop = "saveitem";
468
#-------------------------------------------------------------------------------
467
#-------------------------------------------------------------------------------
469
} elsif ($op eq "dupeitem") {
468
} elsif ($op eq "dupeitem") {
470
#-------------------------------------------------------------------------------
469
#-------------------------------------------------------------------------------
471
# retrieve item if exist => then, it's a modif
470
# retrieve item if exist => then, it's a modif
472
    $current_item = Koha::Items->find($itemnumber)->unblessed;
471
    $current_item = Koha::Items->find($itemnumber)->unblessed or undef;
473
    # FIXME Handle non existent item
472
    if (!$current_item) { $nextop = "additem"; last; }
474
    if (C4::Context->preference('autoBarcode') eq 'incremental') {
473
    if (C4::Context->preference('autoBarcode') eq 'incremental') {
475
        my ( $barcode ) = C4::Barcodes::ValueBuilder::incremental::get_barcode;
474
        my ( $barcode ) = C4::Barcodes::ValueBuilder::incremental::get_barcode;
476
        $current_item->{barcode} = $barcode;
475
        $current_item->{barcode} = $barcode;
477
- 

Return to bug 32418