Bug 13285 Do the right thing if opacthemes is not set
authorColin Campbell <colin.campbell@ptfs-europe.com>
Tue, 18 Nov 2014 14:07:49 +0000 (14:07 +0000)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Sun, 28 Dec 2014 23:30:36 +0000 (20:30 -0300)
If opacthemes is not defined updatedatabase reports the
subsequent warnings as an error. Take account of the case where
it is not set and default that to bootstrap.

This is probably a rare occurence, but should be handled

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
installer/data/mysql/updatedatabase.pl

index 5dab69d..c380800 100755 (executable)
@@ -8922,7 +8922,7 @@ if ( CheckVersion($DBversion) ) {
 $DBversion = "3.17.00.040";
 if ( CheckVersion($DBversion) ) {
     my $opac_theme = C4::Context->preference( 'opacthemes' );
-    if ( $opac_theme eq 'prog' || $opac_theme eq 'ccsr' ) {
+    if ( !defined $opac_theme || $opac_theme eq 'prog' || $opac_theme eq 'ccsr' ) {
         $dbh->do("UPDATE systempreferences SET value='bootstrap' WHERE variable='opacthemes'");
     }
     print "Upgrade to $DBversion done (Bug 12223: 'prog' and 'ccsr' themes removed)\n";