Skip Menu |

This queue is for tickets about the Maypole-FormBuilder CPAN distribution.

Report information
The Basics
Id: 13799
Status: resolved
Priority: 0/
Queue: Maypole-FormBuilder

People
Owner: Nobody in particular
Requestors: davekam [...] pobox.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: editlist template broken for tables with no rows
This line in the editlist mode of the list template: % foreach my $field ( grep { $_->type ne 'hidden' } $forms[0]->fields ) { Fails when no rows are found, because $forms[0] is empty. Possibly it would be necessary here to look inside the FormBuilder args... this could get messy.
[guest - Wed Jul 20 16:00:47 2005]: Show quoted text
> This line in the editlist mode of the list template: > > % foreach my $field ( grep { $_->type ne 'hidden' } $forms[0]->fields > ) { > > Fails when no rows are found, because $forms[0] is empty. Possibly it > would be necessary here to look inside the FormBuilder args... this > could get messy.
Haven't tested it (I broke my dev server), but this should work: % my $dummy_form = $forms[0] || $request->model_class->as_form( mode => 'editlist' ); % foreach my $field ( grep { $_->type ne 'hidden' } $dummy_form->fields ) {