From 0a3348f16ee9f8c3bba4da6951249914f88116b7 Mon Sep 17 00:00:00 2001 From: Dan Wells Date: Thu, 12 Feb 2015 13:08:52 -0500 Subject: [PATCH] LP#1425191 Restore summarization of serial units 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 Signed-off-by: Kathy Lussier --- .../src/perlmods/lib/OpenILS/Application/Serial.pm | 13 ++++++++++++- 1 file changed, 12 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 07cd43a0f5..50113ebc52 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm @@ -2086,7 +2086,18 @@ sub _summarize_contents { } 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; -- 2.43.2