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