I've found that without $c->request as a parameter to process(), the
form parameters are never found. Docs don't mention that.
Attached is a partial correction.
Note, I'm doing this:
sub transaction : Chained('lead') PathPart Args(1) {
my ($self, $c, $foo) = @_;
my $transactionType = $c->model('...')->getTransactionType($foo);
my $form = $self->transactionLoadForm( $c, $transactionType );
}
sub transactionLoadForm : Private {
my ( $self, $c, $transactionType ) = @_;
my $formFile = $c->path_to(qw{root forms }, $transactionType);
my $form = $self->form;
$form->load_config_file($formFile);
$form->process($c->request); ### $c->request is required
$c->stash->{'form'} = $form;
return $form;
}
Subject: | processdocs.patch |
*** FormFu.pm.orig Thu Jun 19 07:07:12 2008
--- FormFu.pm Fri Aug 29 15:02:09 2008
***************
*** 241,247 ****
#
# my $form = $self->form;
#
! # $form->process;
#
# $c->stash->{form} = $form;
}
--- 241,247 ----
#
# my $form = $self->form;
#
! # $form->process($c->request);
#
# $c->stash->{form} = $form;
}
***************
*** 255,261 ****
#
# $form->load_config_file('root/forms/my/controller/bar.yml');
#
! # $form->process;
#
# $c->stash->{form} = $form;
#
--- 255,261 ----
#
# $form->load_config_file('root/forms/my/controller/bar.yml');
#
! # $form->process($c->request);
#
# $c->stash->{form} = $form;
#
***************
*** 277,283 ****
#
# $form->load_config_file('root/forms/my_config.yml');
#
! # $form->process;
#
# $c->stash->{form} = $form;
#
--- 277,283 ----
#
# $form->load_config_file('root/forms/my_config.yml');
#
! # $form->process($c->request);
#
# $c->stash->{form} = $form;
#
***************
*** 299,305 ****
#
# $form->populate( $c->load_form );
#
! # $form->process;
#
# $c->stash->{form} = $form;
#
--- 299,305 ----
#
# $form->populate( $c->load_form );
#
! # $form->process($c->request);
#
# $c->stash->{form} = $form;
#