@@ -, +, @@ $ kshell k$ prove t/db_dependent/Filter_MARC_ViewPolicy.t --- Koha/Filter/MARC/ViewPolicy.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/Koha/Filter/MARC/ViewPolicy.pm +++ a/Koha/Filter/MARC/ViewPolicy.pm @@ -86,7 +86,11 @@ sub filter { my $result = $current_record; my $hide = _should_hide_on_interface(); - my $marcsubfieldstructure = GetMarcStructure( 0, $frameworkcode, { unsafe => 1 } ); + unless ( exists $self->{_cached_frameworks}->{$frameworkcode} ) { + $self->{_cached_frameworks}->{$frameworkcode} = GetMarcStructure( 0, $frameworkcode, { unsafe => 1 } ); + } + + my $marcsubfieldstructure = $self->{_cached_frameworks}->{$frameworkcode}; #if ($marcsubfieldstructure->{'000'}->{'@'}->{hidden}>0) { # LDR field is excluded from $current_record->fields(). --