Lines 222-227
sub delete {
Link Here
|
222 |
$indexer->index_records( $self->biblionumber, "specialUpdate", "biblioserver" ) |
222 |
$indexer->index_records( $self->biblionumber, "specialUpdate", "biblioserver" ) |
223 |
unless $params->{skip_record_index}; |
223 |
unless $params->{skip_record_index}; |
224 |
|
224 |
|
|
|
225 |
if ( C4::Context->preference('EnableVolumes') ) { |
226 |
my $volume_item = |
227 |
Koha::Biblio::Volume::Items->find( { itemnumber => $self->itemnumber } ); |
228 |
my $volume_id = $volume_item ? $volume_item->volume_id : undef; |
229 |
|
230 |
# If this item is the last item on a volume, delete the volume as well |
231 |
if ($volume_id) { |
232 |
my $volume = Koha::Biblio::Volumes->find($volume_id); |
233 |
$volume->delete unless $volume->items->count > 1; |
234 |
} |
235 |
} |
236 |
|
225 |
$self->_after_item_action_hooks({ action => 'delete' }); |
237 |
$self->_after_item_action_hooks({ action => 'delete' }); |
226 |
|
238 |
|
227 |
logaction( "CATALOGUING", "DELETE", $self->itemnumber, "item" ) |
239 |
logaction( "CATALOGUING", "DELETE", $self->itemnumber, "item" ) |
228 |
- |
|
|