From b043eac50c024e9e2f5a79f6a0dc92d78a82efc8 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 26 Aug 2016 13:32:00 +0100 Subject: [PATCH] Bug 17201: (bug 16431 follow-up) Remove occurrence of marcfromkohafield I am not sure this code is called so I don't know how to test it. Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer Signed-off-by: Kyle M Hall --- Koha/MetadataRecord.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Koha/MetadataRecord.pm b/Koha/MetadataRecord.pm index 1b2f4aa2f6..9899e164c7 100644 --- a/Koha/MetadataRecord.pm +++ b/Koha/MetadataRecord.pm @@ -35,6 +35,7 @@ and authority) records in Koha. use Modern::Perl; use Carp; +use C4::Biblio; use Koha::Util::MARC; use base qw(Class::Accessor); @@ -112,12 +113,13 @@ sub getKohaField { my ($self, $kohafield) = @_; if ($self->schema =~ m/marc/) { - my $relations = C4::Context->marcfromkohafield->{''}; - my $tagfield = $relations->{$kohafield}; + my $frameworkcode = ""; # FIXME Why do we use the default framework? + my $mss = C4::Biblio::GetMarcSubfieldStructure( $frameworkcode ); + my $tagfield = $mss->{$kohafield}; - return '' if ref($tagfield) ne 'ARRAY'; + return '' if ref($tagfield) ne 'HASH'; - my ($tag, $subfield) = @$tagfield; + my ($tag, $subfield) = ( $tagfield->{tagfield}, $tagfield->{tagsubfield} ); my @kohafield; foreach my $field ( $self->record->field($tag) ) { if ( $field->tag() < 10 ) { -- 2.39.5