[Catalyst] C::P::FormBuilder question/problem

Joe Landman landman at scalableinformatics.com
Sat Dec 30 22:13:31 GMT 2006


Hi folks:

  I want to stop building my own forms and use one of the C::P modules.
 FormBuilder looked quite good.

  I (largely) followed the example in the manual.  I am trying to build
a login web form for an app.  Unfortunately something isn't quite
working.  I see nothing (e.g. zero) output from the call, though it
looks like from the log, that things are working.  Am I missing
something obvious here?  The man pages suggest that this should work ...
 (note:  I can call $c->form->render and send it to the log file).  I am
using Mason for the view, and a simple SQLite3 DB for the model.

My login.fb looks like this:

# Form config file root/forms/books/edit.fb
name: login_form
method: post
fields:
        username:
            label: User name
            type:  text
            size:  40
            required: 1
        password:
            label: Password
            type:  password
            size:  40
            validate: NAME
            required: 1

    submit: Login
    reset:  Clear

My Root.pm controller has this in it

sub login : Local Form {
     my ($self, $c) = @_;
     my $form;
     $c->log->debug("In login\n");
     if ($c->form->submitted && $c->form->validate)
      {
       $c->forward('/login_check') ;
      }
     $c->log->debug("leaving login\n");
     }

When tested without the login method, it generates output properly,
specifically the Catalyst default page (haven't changed it, in order to
keep sanity checks while building this)

When tested with the login method, it generates no output whatsoever.
The log shows this:

[info] SI powered by Catalyst 5.7006
You can connect to your server at
http://crunch-r.scalableinformatics.com:3000
[CGI::FormBuilder::Messages::new] (debug1) creating Messages object from
(default)
[CGI::FormBuilder::new] (debug1) creating fields list
[CGI::FormBuilder::new] (debug2) assuming fields list from ARRAY
[CGI::FormBuilder::new_field] (debug1) called $form->new_field(username)
[CGI::FormBuilder::new_field] (debug2) rearrange: $args->{cleanopts} = 1;
[CGI::FormBuilder::new_field] (debug2) rearrange: $args->{sticky} = 1;
[CGI::FormBuilder::new_field] (debug2) rearrange: $args->{selectname} = 1;
[CGI::FormBuilder::new_field] (debug2) rearrange: $args->{selectnum} = 5;
[CGI::FormBuilder::new_field] (debug1) created field username
[CGI::FormBuilder::new] (debug2) push @(), username
[CGI::FormBuilder::new_field] (debug1) called $form->new_field(password)
[CGI::FormBuilder::new_field] (debug2) rearrange: $args->{cleanopts} = 1;
[CGI::FormBuilder::new_field] (debug2) rearrange: $args->{sticky} = 1;
[CGI::FormBuilder::new_field] (debug2) rearrange: $args->{selectname} = 1;
[CGI::FormBuilder::new_field] (debug2) rearrange: $args->{selectnum} = 5;
[CGI::FormBuilder::new_field] (debug1) created field password
[CGI::FormBuilder::new] (debug2) push @(username), password
[CGI::FormBuilder::new] (debug1) field creation done, list = (username
password)
[info] *** Request 1 (0.143/s) [23620] [Sat Dec 30 17:07:09 2006] ***
[debug] "GET" request for "login" from "192.168.1.10"
[debug] Path is "login"
[debug] Form (login): Set action to /login
[debug] Form (login): Looking for config file login.fb
[debug] Form (login): Found form config /srv/sites/sc/SI/root/forms/login.fb
[debug] Form (login): Calling FormBuilder->new to create form
[debug] In login
[debug] leaving login
[info] Request took 0.028199s (35.462/s)
.----------------------------------------------------------------+-----------.
| Action                                                         | Time
     |
+----------------------------------------------------------------+-----------+
| /login                                                         |
0.000326s |
'----------------------------------------------------------------+-----------'

Thanks.

Joe


-- 
Joe Landman
landman |at| scalableinformatics |dot| com



More information about the Catalyst mailing list