From 4141333de251c1ff1cbe56d7ccbef1a3b892843d Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Tue, 5 Aug 2025 14:00:31 +0200 Subject: [PATCH] Bug 30915: (QA follow-up) Add warning for notices with Context.Scalar Content-Type: text/plain; charset=utf-8 As requested on comment4. Test plan: Run the dbrev. Bonus: Add a Context.Scalar construct in a notice and rerun. Signed-off-by: Marcel de Rooy --- .../data/mysql/atomicupdate/bug_30915.pl | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_30915.pl diff --git a/installer/data/mysql/atomicupdate/bug_30915.pl b/installer/data/mysql/atomicupdate/bug_30915.pl new file mode 100755 index 0000000000..8b11bd7f2b --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_30915.pl @@ -0,0 +1,25 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_success say_info); + +return { + bug_number => 30915, + description => "Warn for use of Context.Scalar in notices", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + my $notices = $dbh->selectcol_arrayref( + q{ + SELECT code FROM letter WHERE content LIKE '%Context.Scalar%' + } + ); + if (@$notices) { + say_warning( + $out, + q|We discovered that your notices as mentioned below are still using Context.Scalar. Please adjust them by following the instructions on Bugzilla report 30915. In most cases [% Context.Scalar($x,$y) %] should simply be [% $x.$y %].| + . qq|\nWe found the following notices: | + . join( ', ', @$notices ) . q|.| + ); + } + }, +}; -- 2.39.5