In a previous commit, code was added for force summaries to be limited
to a certain type (to prevent cross type contamination of summaries).
This had the negative side-effect of preventing summaries on units, as
the units were not requesting a 'type' for their summary.
While we could force the unit code to send a type, it seemed generally
more flexible to restore the removed support for returning all summary
information in the absense of a requested type. This could lead to
cross-type summaries for units, but that is a larger issue altogether
(i.e. how we can properly support cross-type units at all).
Signed-off-by: Dan Wells <dbw2@calvin.edu>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
}
my @formatted_parts;
- my @scap_fields_ordered = $mfhd->field($MFHD_TAGS_BY_NAME{$type});
+ my @scap_fields_ordered;
+ if ($type) {
+ @scap_fields_ordered = $mfhd->field($MFHD_TAGS_BY_NAME{$type});
+ } else {
+ # if they didn't give a type, send back whatever holdings we have.
+ # this is really only sensible right now for summarizing one type,
+ # and is used by the unitize code for this purpose
+ #
+ # TODO: possible future support for binding (unitizing) of multiple
+ # types into a sensible summary string
+ @scap_fields_ordered = $mfhd->field('85[345]');
+ }
foreach my $scap_field (@scap_fields_ordered) { #TODO: use generic MFHD "summarize" method, once available
my @updated_holdings;