From 9955d984d6d496218fcc90134e7ccf5f10dbb2ec Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 11 Oct 2017 12:50:26 -0300 Subject: [PATCH] Bug 16401: Add a warning if letter.content matches staffClientBaseURL --- installer/data/mysql/atomicupdate/bug_16401.perl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/installer/data/mysql/atomicupdate/bug_16401.perl b/installer/data/mysql/atomicupdate/bug_16401.perl index 3f3492e1ee..75d899d066 100644 --- a/installer/data/mysql/atomicupdate/bug_16401.perl +++ b/installer/data/mysql/atomicupdate/bug_16401.perl @@ -2,6 +2,13 @@ $DBversion = 'XXX'; # will be replaced by the RM if( CheckVersion( $DBversion ) ) { $dbh->do( "UPDATE systempreferences SET value = CONCAT('http://', value) WHERE variable = 'staffClientBaseURL' AND value <> '' AND value NOT LIKE 'http%'" ); + my ( $staffClientBaseURL_used_in_notices ) = $dbh->selectrow_array(q| + SELECT COUNT(*) FROM letter where content like "%staffClientBaseURL%" + |); + if ( $staffClientBaseURL_used_in_notices ) { + warn "\tYou may need to update one or more notice templates if they contain 'staffClientBaseURL'\n"; + } + # Always end with this (adjust the bug info) SetVersion( $DBversion ); print "Upgrade to $DBversion done (Bug 16401 - fix potentialy bad set staffClientBaseURL preference)\n"; -- 2.11.0