bug 3923 followup - change orderpdfformat value if set wrong due to upgrade
authorNicole Engard <nengard@gmail.com>
Fri, 5 Feb 2010 10:23:42 +0000 (05:23 -0500)
committerGalen Charlton <gmcharlt@gmail.com>
Tue, 9 Feb 2010 02:13:20 +0000 (21:13 -0500)
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
installer/data/mysql/updatedatabase.pl

index 2406a41..a63a162 100755 (executable)
@@ -3429,6 +3429,15 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     SetVersion ($DBversion);
 }
 
+$DBversion = 'XXX';
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+       if (C4::Context->preference('OrderPdfFormat') eq 'pdfformat::example'){
+               $dbh->do("UPDATE `systempreferences` set value='pdfformat::layout2pages' WHERE variable='OrderPdfFormat'");
+       }
+       print "Upgrade done ( corrected default OrderPdfFormat value is still set wrong )\n";
+    SetVersion ($DBversion);
+}
+
 =item DropAllForeignKeys($table)
 
   Drop all foreign keys of the table $table