Bug 36244: Add atomic update to check for affected notices

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Fixed some typos in bug numbers and text.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2e18611b7d8527c7ff9253a7669aad2c13a5afb0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Kyle M Hall 2024-03-07 11:10:35 -05:00 committed by Fridolin Somers
parent 378be559c2
commit 2828ea756d
1 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,27 @@
use Modern::Perl;
return {
bug_number => "36244",
description => "Template Toolkit syntax not escaped in letter templates",
up => sub {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
my $query = q{SELECT * FROM letter WHERE content LIKE "[|%%SET%<<%|%]" ESCAPE '|'};
my $sth = $dbh->prepare($query);
$sth->execute();
if ( $sth->rows ) {
say $out "You have one or more templates that have been affected by bug 36244.";
say $out "These templates assign template toolkit variables values";
say $out "using the double arrows syntax. E.g. [% SET name = '<<branches.branchname>>' %]";
say $out
"This will no longer function correctly as Template Toolkit is now rendered before the double arrow syntax.";
say $out "The following notices will need to be updated:";
while ( my $row = $sth->fetchrow_hashref() ) {
say $out
"ID: $row->{id} / MODULE: $row->{module} / CODE: $row->{code} / BRANCHCODE: $row->{branchcode} / NAME: $row->{name}";
}
}
},
};