Bug 29284: (follow-up) Improve error logging to prevent warns

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Nick Clemens 2021-10-21 10:26:12 +00:00 committed by Jonathan Druart
parent b8c32b2cca
commit 9cf301ac6f
3 changed files with 11 additions and 4 deletions

View file

@ -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

View file

@ -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(

View file

@ -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();