Lines 377-387
if ($op eq "additem") {
Link Here
|
377 |
# check that there is no issue on this item before deletion. |
377 |
# check that there is no issue on this item before deletion. |
378 |
my $item = Koha::Items->find($itemnumber); |
378 |
my $item = Koha::Items->find($itemnumber); |
379 |
my $deleted = $item->safe_delete; |
379 |
my $deleted = $item->safe_delete; |
380 |
if($deleted) { |
380 |
unless ( $deleted ) { |
381 |
print $input->redirect("additem.pl?biblionumber=$biblionumber&frameworkcode=$frameworkcode&searchid=$searchid"); |
381 |
print $input->redirect("additem.pl?biblionumber=$biblionumber&frameworkcode=$frameworkcode&searchid=$searchid"); |
382 |
} else { |
382 |
exit; |
383 |
push @errors, @{$deleted->messages}[0]->message; |
383 |
} |
384 |
$nextop="additem"; |
384 |
else { |
|
|
385 |
push @errors, @{ $deleted->messages }[0]->message; |
386 |
$nextop = "additem"; |
385 |
} |
387 |
} |
386 |
#------------------------------------------------------------------------------- |
388 |
#------------------------------------------------------------------------------- |
387 |
} elsif ($op eq "delallitems") { |
389 |
} elsif ($op eq "delallitems") { |
Lines 389-395
if ($op eq "additem") {
Link Here
|
389 |
my $items = Koha::Items->search({ biblionumber => $biblionumber }); |
391 |
my $items = Koha::Items->search({ biblionumber => $biblionumber }); |
390 |
while ( my $item = $items->next ) { |
392 |
while ( my $item = $items->next ) { |
391 |
my $deleted = $item->safe_delete({ skip_record_index => 1 }); |
393 |
my $deleted = $item->safe_delete({ skip_record_index => 1 }); |
392 |
push @errors, @{$deleted->messages}[0]->message; |
394 |
push @errors, @{$deleted->messages}[0]->message unless $deleted; |
393 |
} |
395 |
} |
394 |
my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); |
396 |
my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); |
395 |
$indexer->index_records( $biblionumber, "specialUpdate", "biblioserver" ); |
397 |
$indexer->index_records( $biblionumber, "specialUpdate", "biblioserver" ); |
396 |
- |
|
|