Bug 16401: (follow-up) Avoid changing empty staffClientBaseURL preference
authorKatrin Fischer <katrin.fischer.83@web.de>
Wed, 20 Sep 2017 21:28:49 +0000 (23:28 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 11 Oct 2017 16:05:35 +0000 (13:05 -0300)
Adds a condition to check that the staffClientBaseUrl is not empty
before updating it with 'http://'.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
installer/data/mysql/atomicupdate/bug_16401.perl

index 946953c..3f3492e 100644 (file)
@@ -1,6 +1,6 @@
 $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 NOT LIKE 'http%'" );
+    $dbh->do( "UPDATE systempreferences SET value = CONCAT('http://', value) WHERE variable = 'staffClientBaseURL' AND value <> '' AND value NOT LIKE 'http%'" );
 
     # Always end with this (adjust the bug info)
     SetVersion( $DBversion );