@@ -, +, @@ value at cataloguing/additem.pl 3.1 empty: /cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=384&itemnumber= 3.2 an itemnumber that doesn't exist: /cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=384&itemnumber=9999999999 3.3 whatever else you come up with.. --- cataloguing/additem.pl | 26 ++++++++----------- .../prog/en/modules/cataloguing/additem.tt | 11 ++++---- 2 files changed, 16 insertions(+), 21 deletions(-) --- a/cataloguing/additem.pl +++ a/cataloguing/additem.pl @@ -161,6 +161,7 @@ if ( $op eq "edititem" || $op eq "dupeitem" ) { if ( !$item ) { $itemnumber = undef; $template->param( item_doesnt_exist => 1 ); + output_and_exit( $input, $cookie, $template, 'unknown_item' ) } } @@ -469,25 +470,20 @@ if ($op eq "additem") { } elsif ($op eq "edititem") { #------------------------------------------------------------------------------- # retrieve item if exist => then, it's a modif - $nextop = "additem"; - if ($itemnumber) { - $current_item = Koha::Items->find($itemnumber)->unblessed; - $nextop = "saveitem"; - } + $current_item = Koha::Items->find($itemnumber)->unblessed; + $nextop = "saveitem"; #------------------------------------------------------------------------------- } elsif ($op eq "dupeitem") { #------------------------------------------------------------------------------- # retrieve item if exist => then, it's a modif - if ($itemnumber) { - $current_item = Koha::Items->find($itemnumber)->unblessed; - if ( C4::Context->preference('autoBarcode') eq 'incremental' ) { - my ($barcode) = - C4::Barcodes::ValueBuilder::incremental::get_barcode; - $current_item->{barcode} = $barcode; - } - else { - $current_item->{barcode} = undef; # Don't save it! - } + $current_item = Koha::Items->find($itemnumber)->unblessed; + if ( C4::Context->preference('autoBarcode') eq 'incremental' ) { + my ($barcode) = + C4::Barcodes::ValueBuilder::incremental::get_barcode; + $current_item->{barcode} = $barcode; + } + else { + $current_item->{barcode} = undef; # Don't save it! } $nextop = "additem"; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt @@ -66,6 +66,11 @@