Minor summary regeneration fixes collab/dbwells/regen_serial_summaries
authorDan Wells <dbw2@calvin.edu>
Wed, 1 May 2013 20:20:53 +0000 (16:20 -0400)
committerDan Wells <dbw2@calvin.edu>
Wed, 1 May 2013 20:20:53 +0000 (16:20 -0400)
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 <dbw2@calvin.edu>
Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm

index b00cc69..ba31a52 100644 (file)
@@ -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;