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)

Signed-off-by: Séverine Queune <severine.queune@bulac.fr>

Signed-off-by: Séverine Queune <severine.queune@bulac.fr>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Fridolin Somers 2021-01-14 16:41:07 +01:00
parent 410eb78a73
commit 28b478f8ab
1 changed files with 1 additions and 1 deletions

View File

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