From 74c81e4e8b4a70861ef17b46e75eaea7401068c0 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 Content-Type: text/plain; charset=utf-8 Signed-off-by: Marcel de Rooy --- 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.20.1