diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl index d347012101..0589968e76 100755 --- a/admin/marc_subfields_structure.pl +++ b/admin/marc_subfields_structure.pl @@ -276,6 +276,7 @@ if ( $op eq 'add_form' ) { my %row_data; # get a fresh hash for the row data $row_data{'new_subfield'} = 1; $row_data{'subfieldcode'} = ''; + $row_data{'maxlength'} = 9999; $row_data{tab} = CGI::scrolling_list( -name => 'tab', diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 74061c0f8b..54cf3b2692 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -6974,6 +6974,13 @@ if ( CheckVersion($DBversion) ) { SetVersion ($DBversion); } +$DBversion = "3.12.10.XXX"; +if(CheckVersion($DBversion)) { + $dbh->do("UPDATE marc_subfield_structure SET maxlength=9999 WHERE maxlength IS NULL OR maxlength=0;"); + print "Upgrade to $DBversion done (Bug 8018: new subfields have a default max length of zero)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/marc_subfields_structure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/marc_subfields_structure.tt index 3307318fa5..35d6e1d185 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/marc_subfields_structure.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/marc_subfields_structure.tt @@ -69,7 +69,7 @@ To edit the subfields associated with the tag, click 'Subfields' to the right of