use URI::Escape qw( uri_escape_utf8 );
use C4::Members;
use Koha::UI::Form::Builder::Item;
+use Koha::Result::Boolean;
use MARC::File::XML;
use URI::Escape qw( uri_escape_utf8 );
#-------------------------------------------------------------------------------
# check that there is no issue on this item before deletion.
my $item = Koha::Items->find($itemnumber);
- my $deleted = $item->safe_delete;
+ my $deleted;
+ if( $item ) {
+ $deleted = $item->safe_delete;
+ } else {
+ $deleted = Koha::Result::Boolean->new(0)->add_message({ message => 'item_not_found' });
+ }
if ( $deleted ) {
print $input->redirect("additem.pl?biblionumber=$biblionumber&frameworkcode=$frameworkcode&searchid=$searchid");
exit;
my @subfields_to_prefill;
if ( $nextop eq 'additem' && $op ne 'dupeitem' && $prefillitem ) {
@subfields_to_prefill = split(' ', C4::Context->preference('SubfieldsToUseWhenPrefill'));
- # Setting to 1 element if SubfieldsToUseWhenPrefill is empty to prevent all the subfields to be prefilled
- @subfields_to_prefill = ("") unless @subfields_to_prefill;
}
# Getting list of subfields to keep when restricted editing is enabled