Bug 7855 - marcflavour files changed to set the maxlength field into fresh installs...
[koha_gimpoz] / installer / data / mysql / updatedatabase.pl
index 6e7ca1b..e76d818 100755 (executable)
@@ -4664,7 +4664,7 @@ ENDOFRENEWAL
 
 $DBversion = "3.07.00.012";
 if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
-    $dbh->do("INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('AllowItemsOnHoldCheckout',0,'Do not generate RESERVE_WAITING and RESERVED warning when checking out items reserved to someone else. This allows self checkouts for those items.','','YesNo')");
+    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowItemsOnHoldCheckout',0,'Do not generate RESERVE_WAITING and RESERVED warning when checking out items reserved to someone else. This allows self checkouts for those items.','','YesNo')");
     print "Upgrade to $DBversion add 'AllowItemsOnHoldCheckout' syspref \n";
     SetVersion ($DBversion);
 }
@@ -5044,6 +5044,9 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
        UPDATE marc_subfield_structure SET maxlength = IF ((SELECT value FROM systempreferences WHERE variable = 'marcflavour')='MARC21','40','9999') WHERE tagfield='008';
        ");
        $dbh->do("
+       UPDATE marc_subfield_structure SET maxlength = IF ((SELECT value FROM systempreferences WHERE variable = 'marcflavour')='NORMARC','40','9999') WHERE tagfield='008';
+       ");
+       $dbh->do("
        UPDATE marc_subfield_structure SET maxlength = IF ((SELECT value FROM systempreferences WHERE variable = 'marcflavour')='UNIMARC','36','9999') WHERE tagfield='100';
        ");
     print "Upgrade to $DBversion done (Add new field maxlength to marc_subfield_structure)\n";