From: Dan Wells Date: Wed, 1 May 2013 20:20:53 +0000 (-0400) Subject: Minor summary regeneration fixes X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fcollab%2Fdbwells%2Fregen_serial_summaries;p=working%2FEvergreen.git Minor summary regeneration fixes 1) Remove non-existant 'do_combined' option setting in _prepare_summaries() call 2) Abort if there are no issuances of this type (to prevent empty summaries which confuse the display code). 3) Add a TODO for considering an edge case of a merging record with nothing to merge. Signed-off-by: Dan Wells --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm index b00cc69fd3..ba31a5249d 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm @@ -1604,7 +1604,11 @@ sub regenerate_summaries { } ]) or return $e->die_event; - my $evt = _prepare_summaries($e, $issuances, $sdist, $type, 1); #XXX $do_combined) + return undef if !@$issuances; # abort to prevent empty summary creation (i.e. '[]') + #TODO: we should also consider regenerating if we have a non-empty + # MFHD record and we are set to 'merge', but that is an edge case, + # and would require support deeper into the summary generation stack + my $evt = _prepare_summaries($e, $issuances, $sdist, $type); if ($U->event_code($evt)) { $e->rollback; return $evt;