From 2ecbf3a3469bd53d5cb86a825f2df9d169df49af Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Tue, 26 Oct 2021 12:46:25 +0000 Subject: [PATCH] Bug 11175: (QA follow-up) Test message contents for analytics error Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart --- Koha/Biblio.pm | 1 + catalogue/detail.pl | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm index 6c7e39707e..2a1d67a993 100644 --- a/Koha/Biblio.pm +++ b/Koha/Biblio.pm @@ -510,6 +510,7 @@ sub get_marc_components { { type => 'error', message => 'component_search', + payload => $error, } ); } diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 5caffefa0a..0c2bc884d2 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -201,7 +201,7 @@ my $show_analytics; if ( $showcomp eq 'both' || $showcomp eq 'staff' ) { if ( my $components = $biblio->get_marc_components(C4::Context->preference('MaxComponentRecords')) ) { $show_analytics = 1 if @{$components}; # just show link when having results - $template->param( analytics_error => 1 ) if @{$biblio->messages}; + $template->param( analytics_error => 1 ) if grep { $_->message eq 'component_search' } @{$biblio->messages}; my $parts; for my $part ( @{$components} ) { $part = C4::Search::new_record_from_zebra( 'biblioserver', $part ); @@ -222,7 +222,7 @@ if ( $showcomp eq 'both' || $showcomp eq 'staff' ) { } } else { # check if we should show analytics anyway $show_analytics = 1 if @{$biblio->get_marc_components(1)}; # count matters here, results does not - $template->param( analytics_error => 1 ) if @{$biblio->messages}; + $template->param( analytics_error => 1 ) if grep { $_->message eq 'component_search' } @{$biblio->messages}; } # XSLT processing of some stuff -- 2.39.5