From 5739cd798d5a76cb1f69b772ac5a0efde0ec532e Mon Sep 17 00:00:00 2001 From: Pablo Bianchi Date: Wed, 11 Dec 2013 15:54:54 -0300 Subject: [PATCH] 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 Works by defaulting 0 or "" to 9999. Signed-off-by: Chris Cormack Signed-off-by: Katrin Fischer Signed-off-by: Galen Charlton (cherry picked from commit 1ebbf40ecc07b9474e81e20ec1598659ab027d7a) Signed-off-by: Fridolin SOMERS (cherry picked from commit a3f0eb97697213a267de0f8191e2acbc4197f6ab) Signed-off-by: Tomas Cohen Arazi --- admin/marc_subfields_structure.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl index 615fbcfc70..d347012101 100755 --- a/admin/marc_subfields_structure.pl +++ b/admin/marc_subfields_structure.pl @@ -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 ) { -- 2.39.5