From dd69e4d8e9b72e1dbfe559856c9f1f92b8079f64 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Mon, 14 Mar 2022 13:01:22 +0000 Subject: [PATCH] Bug 30290: (follow-up) Add warning for translated notices Note: Problem is that we cannot know if default was translated or en contains the original notice. Actually this holds for the other languages too. So this is an educated guess without using the lang field. Test plan: Run db rev. Trigger the warning by replacing Pages by PPages in an AR notice. Run db rev again. Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi Signed-off-by: Katrin Fischer --- installer/data/mysql/atomicupdate/bug_30290.pl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/installer/data/mysql/atomicupdate/bug_30290.pl b/installer/data/mysql/atomicupdate/bug_30290.pl index c367b4fda2..b2ed7cdb91 100755 --- a/installer/data/mysql/atomicupdate/bug_30290.pl +++ b/installer/data/mysql/atomicupdate/bug_30290.pl @@ -12,5 +12,14 @@ SET content=REPLACE(content, '\nPages:', '\nTOC: [% IF article_request.toc_reque WHERE code RLIKE '^AR_' AND module='circulation' AND content NOT RLIKE '\nTOC:'; |; $dbh->do( $sql ); + + # Warn if we find translated notices (educated guess with word Pages) + $sql=q| +SELECT COUNT(*) +FROM letter +WHERE code RLIKE '^AR_' AND module='circulation' AND content NOT RLIKE '\nPages:'; + |; + my ( $count ) = $dbh->selectrow_array( $sql ); + say $out "WARNING: If you have translated AR notices, please add TOC lines yourself." if $count; }, }; -- 2.30.2