We (TADL) have serial units with no serial items.
There is logic in the unitize_items subroutine in
OpenILS::Application::Serial which "cleans up"
these "dead" units.
While we look into why we have units with no items,
we're disabling this deletion so that we don't
have need to undelete big batches of still-circulating
serial units.
Signed-off-by: Jeff Godin <jgodin@tadl.org>
# cleanup 'dead' units (units which are now emptied of their items)
my $dead_units = $editor->search_serial_unit([{'+sitem' => {'id' => undef}, 'deleted' => 'f'}, {'join' => {'sitem' => {'type' => 'left'}}}]);
foreach my $unit (@$dead_units) {
- _delete_sunit($editor, undef, $unit);
+ # XXX: This _delete_sunit call has been deleting serial units for us (TADL) in large batches of >100
+ # XXX: log the attempt and don't actually delete while we investigate why some of our units have no items.
+ $logger->info("Skipping call to _delete_sunit for unit ID " . $unit->id);
+ # _delete_sunit($editor, undef, $unit);
delete $found_unit_ids{$unit->id};
}