[Koha-bugs] [Bug 7263] Determine maximum length of some fields or subfields when cataloguing

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Mar 30 09:41:21 CEST 2012


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7263

--- Comment #13 from Magnus Enger <magnus at enger.priv.no> ---
But updatedatabase changes the default for a couple of fields: 

+$DBversion = "3.07.00.XXX";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+    $dbh->do("
+       ALTER TABLE  `marc_subfield_structure` ADD  `maxlength` INT( 4 ) NOT
NULL DEFAULT  '9999';
+       ");
+       $dbh->do("
+       UPDATE `marc_subfield_structure` SET maxlength=24 WHERE tagfield='000';
+       ");
+       $dbh->do("
+       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')='UNIMARC','36','9999') WHERE
tagfield='100';
+       ");
+    print "Upgrade to $DBversion done (Add new field maxlength to
marc_subfield_structure)\n";
+    SetVersion($DBversion);
+}
+

So all marcflavours on upgraded installations will have maxlength = 24 for 000,
while fresh installs will have 9999. 

And upgraded MARC21 installations will have maxlength = 40 for field 008 while
fresh installations will have maxlength = 9999. 

Might not be much of a problem, but it will lead to subtle differences in
installations depending on their history and perhaps a potential for future
confusion.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list