From fa989631f6b6f2d4a6dc86e8b9535bd9ce786c1e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 15 Apr 2014 11:08:54 +0200 Subject: [PATCH] Bug 11797: fix odd number of elements in hash (UNIMARC) I got the same warning for my UNIMARC DB. Signed-off-by: Jonathan Druart Signed-off-by: Galen Charlton --- C4/AuthoritiesMarc.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 94098532f9..03531421de 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -967,7 +967,7 @@ sub BuildSummary { foreach my $field ($record->field('2..')) { push @authorized, { heading => $field->as_string('abcdefghijlmnopqrstuvwxyz'), - hemain => $field->subfield('a'), + hemain => ( $field->subfield('a') // undef ), field => $field->tag(), }; } @@ -979,7 +979,7 @@ sub BuildSummary { my $thesaurus = $field->subfield('2') ? "thes. : ".$thesaurus{"$field->subfield('2')"}." : " : ''; push @seefrom, { heading => $thesaurus . $field->as_string('abcdefghijlmnopqrstuvwxyz'), - hemain => $field->subfield('a'), + hemain => ( $field->subfield('a') // undef ), type => 'seefrom', field => $field->tag(), }; @@ -993,9 +993,9 @@ sub BuildSummary { field => $_->tag, type => $type, heading => $heading, - hemain => $_->subfield('a'), + hemain => ( $_->subfield('a') // undef ), search => $heading, - authid => $_->subfield('9'), + authid => ( $_->subfield('9') // undef ), } } $record->field('5..'); -- 2.39.5