From d4258460ae09c44c4c502f25a486d3aaf13dd62f Mon Sep 17 00:00:00 2001 From: Bernardo Gonzalez Kriegel Date: Wed, 13 Aug 2014 21:02:14 -0300 Subject: [PATCH] Bug 12091: Followup to fix remaining validation errors This patch fix all remaining errors. There was a for clause to add multiple new subfields, perhaps old code because now we can only add one subfield at a time, in that block id of html elements where numbered again from '1', and some elements lack proper id numbering, and one of them has incorrect label. I notice this on another patch but left things as they were trying not to broke anything. To test 1. Follow test plan of previous patch, there must be no errors, 1 warning 2. Add a new subfield, check subfield is added without problems --- admin/auth_subfields_structure.pl | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/admin/auth_subfields_structure.pl b/admin/auth_subfields_structure.pl index 96088bd..7305a0c 100755 --- a/admin/auth_subfields_structure.pl +++ b/admin/auth_subfields_structure.pl @@ -185,7 +185,7 @@ if ($op eq 'add_form') { $i++; } # add more_subfields empty lines for add if needed - for (my $i=1;$i<=$more_subfields;$i++) { + my %row_data; # get a fresh hash for the row data $row_data{'new_subfield'} = 1; $row_data{tab} = { @@ -197,11 +197,10 @@ if ($op eq 'add_form') { default => $data->{'hidden'} }; - $row_data{tagsubfieldinput} = "{'tagsubfield'}."\" size=\"1\" id=\"tagsubfield\" maxlength=\"1\" />"; - $row_data{tagsubfieldinput} = + $row_data{tagsubfieldinput} = ""; + . "\" size=\"1\" id=\"tagsubfieldinput".$i."\" maxlength=\"1\" />"; $row_data{tagsubfield} = $data->{'tagsubfield'}; $row_data{liblibrarian} = ""; $row_data{libopac} = ""; @@ -228,24 +227,24 @@ if ($op eq 'add_form') { default => "", }; $row_data{authorised_value} = { - id => "authorised_value", + id => "authorised_value$i", values => $authorised_values, default => "", }; $row_data{frameworkcode} = { - id => "frameworkcode", + id => "frameworkcode$i", values => \@authtypes, default => $data->{'frameworkcode'}, }; $row_data{value_builder} = { - id => "value_builder", + id => "value_builder$i", values => \@value_builder, default => $data->{'value_builder'}, }; $row_data{row} = $i; push(@loop_data, \%row_data); - } + $template->param('use_heading_flags_p' => 1); $template->param('heading_edit_subfields_p' => 1); $template->param(action => "Edit subfields", -- 1.7.9.5