Bug 16401: Add a warning if letter.content matches staffClientBaseURL

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2017-10-11 12:50:26 -03:00
parent 3d1794123e
commit 95acb17c58

View file

@ -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";