From aeb6034ea9ca525173192145be8c580f96ff4288 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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) Signed-off-by: Séverine Queune Signed-off-by: Séverine Queune Signed-off-by: Nick Clemens Signed-off-by: Fridolin Somers Signed-off-by: Kyle M Hall --- 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 d08be01bf8..555e41d15e 100644 --- a/C4/Reports/Guided.pm +++ b/C4/Reports/Guided.pm @@ -656,7 +656,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.39.5