From a8c8cc24489294177633331bcb63450c201b3242 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Thu, 14 Jan 2021 16:41:07 +0100 Subject: [PATCH] Bug 26669: Avoid a warn in update_sql In C4/Reports/Guided.pm update_sql() called by test suite return warn : Use of uninitialized value $sql in substitution (s///) Test plan : Run prove t/db_dependent/Reports/Guided.t and see warning disapearing (whouchhhh) --- C4/Reports/Guided.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Reports/Guided.pm b/C4/Reports/Guided.pm index 8c89165e2a..b625443a7a 100644 --- a/C4/Reports/Guided.pm +++ b/C4/Reports/Guided.pm @@ -641,7 +641,7 @@ sub update_sql { my $cache_expiry = $fields->{cache_expiry}; my $public = $fields->{public}; - $sql =~ s/(\s*\;\s*)$//; # removes trailing whitespace and /;/ + $sql =~ s/(\s*\;\s*)$// if defined $sql; # removes trailing whitespace and /;/ my $report = Koha::Reports->find($id); $report->last_modified(dt_from_string); $report->savedsql($sql); -- 2.30.0