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

(-)a/Koha/BackgroundJob/BatchDeleteBiblio.pm (-1 / +1 lines)
Lines 108-114 sub process { Link Here
108
        my $items = Koha::Items->search({ biblionumber => $biblionumber });
108
        my $items = Koha::Items->search({ biblionumber => $biblionumber });
109
        while ( my $item = $items->next ) {
109
        while ( my $item = $items->next ) {
110
            my $deleted = $item->safe_delete;
110
            my $deleted = $item->safe_delete;
111
            if( $deleted ) {
111
            unless ( $deleted ) {
112
                push @messages, {
112
                push @messages, {
113
                    type => 'error',
113
                    type => 'error',
114
                    code => 'item_not_deleted',
114
                    code => 'item_not_deleted',
(-)a/cataloguing/additem.pl (-6 / +7 lines)
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
- 

Return to bug 29788