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

(-)a/Koha/Item.pm (-1 / +13 lines)
Lines 186-191 sub delete { Link Here
186
186
187
    C4::Biblio::ModZebra( $self->biblionumber, "specialUpdate", "biblioserver" );
187
    C4::Biblio::ModZebra( $self->biblionumber, "specialUpdate", "biblioserver" );
188
188
189
    if ( C4::Context->preference('EnableVolumes') ) {
190
        my $volume_item =
191
          Koha::Biblio::Volume::Items->find( { itemnumber => $self->itemnumber } );
192
        my $volume_id = $volume_item ? $volume_item->volume_id : undef;
193
194
        # If this item is the last item on a volume, delete the volume as well
195
        if ($volume_id) {
196
            my $volume       = Koha::Biblio::Volumes->find($volume_id);
197
            my @volume_items = $volume->items();
198
            $volume->delete unless @volume_items;
199
        }
200
    }
201
189
    $self->_after_item_action_hooks({ action => 'delete' });
202
    $self->_after_item_action_hooks({ action => 'delete' });
190
203
191
    logaction( "CATALOGUING", "DELETE", $self->itemnumber, "item" )
204
    logaction( "CATALOGUING", "DELETE", $self->itemnumber, "item" )
192
- 

Return to bug 24857