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

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

Return to bug 24857