Bug 8018: MARC framework max subfield length should default to 9999

The default value for the marc_subfield_structure.maxlenght is 9999
in the DB. Currently the template passes an empty value which is casted to
0 by the CGI.

This simple patch validates the input and converts to the default (9999)
if not defined or 0.

Another approach could be changing the 9999 default and/or treating 0 as
'no-limit'.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Works by defaulting 0 or "" to 9999.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
Pablo Bianchi 2013-12-11 15:54:54 -03:00 committed by Galen Charlton
parent 0fc114eee3
commit 1ebbf40ecc
1 changed files with 1 additions and 1 deletions

View File

@ -425,7 +425,7 @@ elsif ( $op eq 'add_validate' ) {
my $isurl = $input->param("isurl$i") ? 1 : 0;
my $link = $link[$i];
my $defaultvalue = $defaultvalue[$i];
my $maxlength = $maxlength[$i];
my $maxlength = $maxlength[$i] ? $maxlength[$i] : 9999;
if (defined($liblibrarian) && $liblibrarian ne "") {
unless ( C4::Context->config('demo') eq 1 ) {