[html-formfu] probably bug in nested forms
Mario Minati
mario.minati at googlemail.com
Sat Nov 3 22:18:57 GMT 2007
Hi,
while reworking the DBIx::Class::HTML::FormFu::fill_formfu_values I found
misformed nested_names:
YAML config of elements (constraints removed for readability):
---
elements:
- type: Fieldset
legend_loc: Description
nested_name: description2
elements:
- type: Text
name: description
label_loc: Label
- type: Multi
label_loc: Use for
container_attrs:
class: vertical
elements:
- type: Checkbox
name: use_for_shipping
label_loc: Shipping
- type: Checkbox
name: use_for_routing
label_loc: Routing
- type: Checkbox
name: use_for_billing
label_loc: billing
I dumped the nested_names in DBIx::Class::HTML::FormFu::fill_formfu_values
like this:
...
for my $field (@$fields) {
my $field_name = $field->name;
my $field_nested_name = $field->nested_name;
warn $field_nested_name;
next unless defined $field_name;
...
And here is the output:
description2[description]
at /home/mario/Desktop/dev/projects/formfu/svn/trunk/DBIx-Class-HTML-FormFu/lib/DBIx/Class/HTML/FormFu.pm
line 37.
description2[description2][use_for_shipping]
at /home/mario/Desktop/dev/projects/formfu/svn/trunk/DBIx-Class-HTML-FormFu/lib/DBIx/Class/HTML/FormFu.pm
line 37.
description2[description2][use_for_routing]
at /home/mario/Desktop/dev/projects/formfu/svn/trunk/DBIx-Class-HTML-FormFu/lib/DBIx/Class/HTML/FormFu.pm
line 37.
description2[description2][use_for_billing]
at /home/mario/Desktop/dev/projects/formfu/svn/trunk/DBIx-Class-HTML-FormFu/lib/DBIx/Class/HTML/FormFu.pm
line 37.
So the nested_name 'description2' gets repeated two times, probably because of
the Multi element in the config.
I'll go hunting ;-)
Greets,
Mario
More information about the HTML-FormFu
mailing list