@@ -, +, @@ 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 @@
+ [% IF item_doesnt_exist %] + + [% END %] [% INCLUDE 'blocking_errors.inc' %]

Items for [% biblio.title | html %] [% IF ( biblio.author ) %] by [% biblio.author | html %][% END %] (Record #[% biblio.biblionumber | html %])

@@ -77,12 +82,6 @@ [% IF ( linked_analytics ) %]
Cannot delete: item has linked analytics..
[% END %] [% IF last_item_for_hold %]
Cannot delete: Last item for bibliographic record with biblio-level hold on it.
[% END %] [% IF item_not_found %]
Cannot delete: Item not found.
[% END %] -[% IF item_doesnt_exist %] -
-The item you are trying to access doesn't exist.
-Add a new item or go to the records holdings. -
-[% END %]
[% IF items %] --