From ba641f3ce98711fb20c118201913684178fc1579 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 15 Apr 2014 11:08:54 +0200 Subject: [PATCH] Bug 11797 - Odd number of elements in hash - UNIMARC I got the same warning for my UNIMARC DB. Signed-off-by: Jonathan Druart --- C4/AuthoritiesMarc.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 9409853..de94a32 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..'); -- 1.7.10.4