From 936e86366cb44c9dce510cd421a546890599e51f Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 22 Oct 2021 10:02:09 +0000 Subject: [PATCH] Bug 11175: (QA follow-up) Remove caching _components Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart --- Koha/Biblio.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm index 49707db06c..f325e5c0f4 100644 --- a/Koha/Biblio.pm +++ b/Koha/Biblio.pm @@ -495,13 +495,14 @@ sub get_marc_components { my $searchstr = $self->get_components_query; + my $components; if (defined($searchstr)) { my $searcher = Koha::SearchEngine::Search->new({index => $Koha::SearchEngine::BIBLIOS_INDEX}); my ( $errors, $results, $total_hits ) = $searcher->simple_search_compat( $searchstr, 0, $max_results ); - $self->{_components} = $results if ( defined($results) && scalar(@$results) ); + $components = $results if defined($results) && @$results; } - return $self->{_components} || []; + return $components // []; } =head2 get_components_query -- 2.39.5