From 6fbd29e7d7aaa3549a71595876d2cdbe60edc7f7 Mon Sep 17 00:00:00 2001 From: Jeff Godin Date: Wed, 9 May 2012 09:51:26 -0400 Subject: [PATCH] Prevent cleanup of "dead" serial units for now 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 --- Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm index a2bab96bda..f0a20b9f89 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm @@ -1288,7 +1288,10 @@ sub unitize_items { # 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}; } -- 2.11.0