From 197faafcc741a03a46e169f6b085ca9a32214cc1 Mon Sep 17 00:00:00 2001 From: Dan Wells Date: Wed, 1 May 2013 16:20:53 -0400 Subject: [PATCH] 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 --- Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm | 6 +++++- 1 file changed, 5 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 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; -- 2.11.0