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

(-)a/Koha/Item.pm (-1 / +13 lines)
Lines 217-222 sub delete { Link Here
217
    C4::Biblio::ModZebra( $self->biblionumber, "specialUpdate", "biblioserver" )
217
    C4::Biblio::ModZebra( $self->biblionumber, "specialUpdate", "biblioserver" )
218
        unless $params->{skip_modzebra_update};
218
        unless $params->{skip_modzebra_update};
219
219
220
    if ( C4::Context->preference('EnableVolumes') ) {
221
        my $volume_item =
222
          Koha::Biblio::Volume::Items->find( { itemnumber => $self->itemnumber } );
223
        my $volume_id = $volume_item ? $volume_item->volume_id : undef;
224
225
        # If this item is the last item on a volume, delete the volume as well
226
        if ($volume_id) {
227
            my $volume       = Koha::Biblio::Volumes->find($volume_id);
228
            my @volume_items = $volume->items();
229
            $volume->delete unless @volume_items;
230
        }
231
    }
232
220
    $self->_after_item_action_hooks({ action => 'delete' });
233
    $self->_after_item_action_hooks({ action => 'delete' });
221
234
222
    logaction( "CATALOGUING", "DELETE", $self->itemnumber, "item" )
235
    logaction( "CATALOGUING", "DELETE", $self->itemnumber, "item" )
223
- 

Return to bug 24857