From 5d96207f2d7996745e34bb5b44980993259b603c Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Mon, 14 Mar 2022 11:54:33 +0000 Subject: [PATCH] Bug 30290: Database revision for existing notices Note: It will be hard to update translated notices. If we cannot find the part 'Pages:' then the replace does not do anything. Test plan: Run db rev. Check an existing AR notice (English). Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi Signed-off-by: Katrin Fischer Signed-off-by: Fridolin Somers --- installer/data/mysql/atomicupdate/bug_30290.pl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_30290.pl diff --git a/installer/data/mysql/atomicupdate/bug_30290.pl b/installer/data/mysql/atomicupdate/bug_30290.pl new file mode 100755 index 0000000000..c367b4fda2 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_30290.pl @@ -0,0 +1,16 @@ +use Modern::Perl; + +return { + bug_number => 30290, + description => "Modify AR notices, include TOC line", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + my $sql = q| +UPDATE letter +SET content=REPLACE(content, '\nPages:', '\nTOC: [% IF article_request.toc_request %]Include TOC[% ELSE %]No[% END %]\nPages:') +WHERE code RLIKE '^AR_' AND module='circulation' AND content NOT RLIKE '\nTOC:'; + |; + $dbh->do( $sql ); + }, +}; -- 2.39.5