Bugzilla – Attachment 126657 Details for
Bug 29284
Koha dies when an analytics search fails in Elasticsearch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29284: (follow-up) Improve error logging to prevent warns
Bug-29284-follow-up-Improve-error-logging-to-preve.patch (text/plain), 2.46 KB, created by
Nick Clemens
on 2021-10-21 10:33:44 UTC
(
hide
)
Description:
Bug 29284: (follow-up) Improve error logging to prevent warns
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2021-10-21 10:33:44 UTC
Size:
2.46 KB
patch
obsolete
>From 7e674c3fc5384dd37a19e73ca85a0a979faa43dd Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 21 Oct 2021 10:26:12 +0000 >Subject: [PATCH] Bug 29284: (follow-up) Improve error logging to prevent warns > >--- > Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 1 + > catalogue/detail.pl | 7 +++++-- > opac/opac-detail.pl | 7 +++++-- > 3 files changed, 11 insertions(+), 4 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index 76b4dbc6b4..607634c405 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -986,6 +986,7 @@ sub clean_search_term { > $term =~ s/((?<!\\)(?:[\\]{2})*:[^:\s]+(?<!\\)(?:[\\]{2})*)(?=:)/$1\\/g; > > # screen all exclamation signs that either are the last symbol or have white space after them >+ # or are followed by close parentheses > $term =~ s/(?:[\s\\]*!\s*)+(\s|$|\))/$1/g; > > # screen all brackets with backslash >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index 4efffed9b8..7d6db515b9 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -147,12 +147,15 @@ my $marcflavour = C4::Context->preference("marcflavour"); > > }; > if ($err || $@){ >- warn "Warning from simple_search_compat: $err.$@"; >+ my $error = q{}; >+ $error .= $err if $err; >+ $error .= $@ if $@; >+ warn "Warning from simple_search_compat: $error"; > $template->param( analytics_error => 1 ); > } > > my $variables = { >- show_analytics_link => $count > 0 ? 1 : 0 >+ show_analytics_link => defined $count && $count > 0 ? 1 : 0 > }; > > $template->param( >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 36c64d4f60..9e12ef8cc4 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -217,12 +217,15 @@ my $ean = GetNormalizedEAN( $record, $marcflavour ); > > }; > if ($err || $@){ >- warn "Warning from simple_search_compat: $err.$@"; >+ my $error = q{}; >+ $error .= $err if $err; >+ $error .= $@ if $@; >+ warn "Warning from simple_search_compat: $error"; > } > > my $variables = { > anonymous_session => ($borrowernumber) ? 0 : 1, >- show_analytics_link => $count > 0 ? 1 : 0 >+ show_analytics_link => defined $count && $count > 0 ? 1 : 0 > }; > > my $lang = C4::Languages::getlanguage(); >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29284
:
126583
|
126584
|
126586
|
126587
|
126656
| 126657 |
126658