thinko with branch handling
authorJason Etheridge <jason@equinoxinitiative.org>
Tue, 11 Aug 2020 19:34:45 +0000 (15:34 -0400)
committerJason Etheridge <jason@equinoxinitiative.org>
Tue, 11 Aug 2020 19:34:45 +0000 (15:34 -0400)
Signed-off-by: Jason Etheridge <jason@equinoxinitiative.org>

emig.d/bin/mig-bibstats

index 1c7013a..a917208 100755 (executable)
@@ -187,7 +187,7 @@ while ( my $record = $batch->next() ) {
         my @holding_fields = $record->field($p_holding_code);
         foreach my $hf (@holding_fields) {
             my $item_type = $hf->subfield($p_item_type_subfield) || '<missing item type subfield>';
-            my $branch = $p_branch_subfield || 'default';
+            my $branch = $p_branch_subfield ? $f->subfield($p_branch_subfield) || 'default';
             if (! defined $bib_types_by_item_type{ $branch }) {
                 $bib_types_by_item_type{ $branch } = {};
             }