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

(-)a/Koha/Item.pm (-1 / +12 lines)
Lines 230-235 sub delete { Link Here
230
    $indexer->index_records( $self->biblionumber, "specialUpdate", "biblioserver" )
230
    $indexer->index_records( $self->biblionumber, "specialUpdate", "biblioserver" )
231
        unless $params->{skip_record_index};
231
        unless $params->{skip_record_index};
232
232
233
    if ( C4::Context->preference('EnableVolumes') ) {
234
        my $volume_item =
235
          Koha::Biblio::Volume::Items->find( { itemnumber => $self->itemnumber } );
236
        my $volume_id = $volume_item ? $volume_item->volume_id : undef;
237
238
        # If this item is the last item on a volume, delete the volume as well
239
        if ($volume_id) {
240
            my $volume = Koha::Biblio::Volumes->find($volume_id);
241
            $volume->delete unless $volume->items->count > 1;
242
        }
243
    }
244
233
    $self->_after_item_action_hooks({ action => 'delete' });
245
    $self->_after_item_action_hooks({ action => 'delete' });
234
246
235
    logaction( "CATALOGUING", "DELETE", $self->itemnumber, "item" )
247
    logaction( "CATALOGUING", "DELETE", $self->itemnumber, "item" )
236
- 

Return to bug 24857