FAQ
Hello!
I am using FormBuilder, CGI::FormBuilder::Source::File, and TT2.
I set the template in the source file:

template:
type: TT2
template: customers/signup.tt2

And get the following error:

undef error - Fatal: file error - customers/signup.tt2: not found at
/usr/local/share/perl/5.8.7/CGI/FormBuilder/Util.pm line 149
CGI::FormBuilder::Util::puke('Template::Exception=ARRAY(0x94b5b90)') called
at /usr/local/share/perl/5.8.7/CGI/FormBuilder/Template/TT2.pm line 66

Might it be that FormBuilder doesn't find the Catalyst template dir, and if
yes, how do I let FB know?
Any help is greatly appreciated.

Best regards,

Moritz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060918/2ff96e31/attachment.htm

Search Discussions

  • Ash Berlin at Sep 18, 2006 at 11:38 am

    Moritz Sisenop wrote:
    Hello!
    I am using FormBuilder, CGI::FormBuilder::Source::File, and TT2.
    I set the template in the source file:

    template:
    type: TT2
    template: customers/signup.tt2

    And get the following error:

    undef error - Fatal: file error - customers/signup.tt2: not found at
    /usr/local/share/perl/5.8.7/CGI/FormBuilder/Util.pm line 149
    CGI::FormBuilder::Util::puke('Template::Exception=ARRAY(0x94b5b90)')
    called at /usr/local/share/perl/5.8.7/CGI/FormBuilder/Template/TT2.pm
    line 66

    Might it be that FormBuilder doesn't find the Catalyst template dir,
    and if yes, how do I let FB know?
    Any help is greatly appreciated.

    Best regards,

    Moritz
    ------------------------------------------------------------------------

    _______________________________________________
    List: Catalyst at lists.rawmode.org
    Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
    Searchable archive: http://www.mail-archive.com/catalyst at lists.rawmode.org/
    Dev site: http://dev.catalyst.perl.org/
    What i think you want is $c->path_to(qw/root customers signup.tt2/)

    Ash
  • John Napiorkowski at Sep 18, 2006 at 1:41 pm

    -- Ash Berlin wrote:

    Moritz Sisenop wrote:
    Hello!
    I am using FormBuilder,
    CGI::FormBuilder::Source::File, and TT2.
    I set the template in the source file:

    template:
    type: TT2
    template: customers/signup.tt2

    And get the following error:

    undef error - Fatal: file error -
    customers/signup.tt2: not found at
    /usr/local/share/perl/5.8.7/CGI/FormBuilder/Util.pm
    line 149
    CGI::FormBuilder::Util::puke('Template::Exception=ARRAY(0x94b5b90)')
    called at
    /usr/local/share/perl/5.8.7/CGI/FormBuilder/Template/TT2.pm
    line 66

    Might it be that FormBuilder doesn't find the
    Catalyst template dir,
    and if yes, how do I let FB know?
    Any help is greatly appreciated.

    Best regards,

    Moritz
    I had a similar trouble when I just started to use
    formbuilder. Here's what I did:

    First, I put some global config stuff into my catalyst
    myapp.yml file:

    ##
    ## Formbuilding options
    ##
    form:
    method: post
    form_path: __path_to(root)__

    the 'form_path' option I set so that by default my
    *.fb files end up in the same location as my template
    toolkit files.

    Then I find that if I am using a reasonably standard
    setup for TT my actions automatically find the *.fb
    and *.tt files for me.

    that '__path)to...__' biz is something that the
    ConfigLoader plugin translates for you, I am doubtful
    it will work in your standard *.fb file.

    Hey, question for you; are you using Formbuilder with
    a database? If so what are you doing to manage
    getting stuff between formbuild and your datbase of
    choice? I'm using DBIx and just doing braindead stuff
    like writing a bunch of $c->form->field(name=>,
    value=>) but I figure there's a better way. I just
    can't seem to get DBIx::Class::FormTools to do what I
    think it can do for me. Maybe I just need more work
    on it.

    --john

    __________________________________________________
    Do You Yahoo!?
    Tired of spam? Yahoo! Mail has the best spam protection around
    http://mail.yahoo.com
  • Roy-Magne Mo at Sep 18, 2006 at 7:50 pm

    Moritz Sisenop wrote:
    Hello!
    I am using FormBuilder, CGI::FormBuilder::Source::File, and TT2.
    Did you consider using Catalyst::Plugin::FormBuilder?

    --
    Roy-Magne Mo
  • Moritz Sisenop at Sep 19, 2006 at 5:37 am
    When I try

    $c->path_to(qw/root customers signup.tt2/)

    there is no Catalyst error message anymore.
    Just a TT one: "Not a GLOB reference at
    /usr/local/lib/perl/5.8.7/Template/Provider.pm line 647."

    I didn't
    try what John recommended since I want to keep my form descriptions
    and tt-templates in different dirs.
    Instead tried

    template:
    type: TT2
    template: __path_to(root src customers signup.tt2)__
    engine:
    include_path: __path_to(root src)__
    INTERPOLATE: 1
    ABSOLUTE: 1

    but that didn't work.

    John, I am can't even worry about the DB stuff right now ;)
    Roy, sorry I meant to write I am using Catalyst::Plugin::FormBuilder

    Regards,

    Moritz
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060919/b66187af/attachment.htm
  • Jason Kohles at Sep 19, 2006 at 11:56 am

    On Sep 19, 2006, at 1:37 AM, Moritz Sisenop wrote:

    When I try

    $c->path_to(qw/root customers signup.tt2/)

    there is no Catalyst error message anymore.
    Just a TT one: "Not a GLOB reference at /usr/local/lib/perl/5.8.7/
    Template/Provider.pm line 647."
    Template Toolkit doesn't know what to do with the Path::Class::File
    object that path_to is going to return,
    use $c->path_to(qw/root customer signup.tt2/)->stringify instead.

    --
    Jason Kohles
    email at jasonkohles.com
    http://www.jasonkohles.com/
    "A witty saying proves nothing." -- Voltaire


    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060919/df06d7f3/attachment.htm
  • Moritz Sisenop at Sep 21, 2006 at 6:54 am
    Thank you guys for your help.
    Somehow it works now, though I don't know why.
    All I have now is my Formbuilder source file

    and
    $c->stash->{template}
    in the controller.
    I am quite sure that I had the same setup during my experimentation, but I
    don't know why it works now.

    Once again, thank you all for your help.

    Regards,

    Moritz
    On 9/19/06, Jason Kohles wrote:

    On Sep 19, 2006, at 1:37 AM, Moritz Sisenop wrote:

    When I try

    $c->path_to(qw/root customers signup.tt2/)

    there is no Catalyst error message anymore.
    Just a TT one: "Not a GLOB reference at
    /usr/local/lib/perl/5.8.7/Template/Provider.pm line 647."

    Template Toolkit doesn't know what to do with the Path::Class::File object
    that path_to is going to return,
    use $c->path_to(qw/root customer signup.tt2/)->stringify instead.

    --
    Jason Kohles
    email at jasonkohles.com
    http://www.jasonkohles.com/
    "A witty saying proves nothing." -- Voltaire



    _______________________________________________
    List: Catalyst at lists.rawmode.org
    Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
    Searchable archive:
    http://www.mail-archive.com/catalyst at lists.rawmode.org/
    Dev site: http://dev.catalyst.perl.org/

    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060921/a8dadea8/attachment.htm
  • Karl Moens at Sep 19, 2006 at 10:13 am

    John Napiorkowski wrote:
    (snip)

    Hey, question for you; are you using Formbuilder with
    a database? If so what are you doing to manage
    getting stuff between formbuild and your datbase of
    choice? I'm using DBIx and just doing braindead stuff
    like writing a bunch of $c->form->field(name=>,
    value=>) but I figure there's a better way. I just
    can't seem to get DBIx::Class::FormTools to do what I
    think it can do for me. Maybe I just need more work
    on it.
    I'm using Catalyst::Plugin::FormBuilder and in order to transfer data back
    and forth between the forms and the database (accessed with DBIx::Class) I
    do something like:

    1. Make sure that your form-fields have the same names as your columns
    accessors.
    2. Give your sub-routines to which Catalyst dispatches your URL's the ":
    Form" attribute.
    3a. To add a record:
    <code>my ( $self, $c ) = @_;
    if ($c->form->submitted && $c->form->validate) {
    my $record=$c->model('Your::table')->create(scalar
    $c->form->field());
    }</code>
    3b. To edit a record:
    <code>my ( $self, $c, $key ) = @_;
    my $record=$c->model('Your::table')->find($key);
    if ($c->form->submitted && $c->form->validate) {
    $record->update(scalar $c->form->field());
    }
    else {
    map {$c->form->field('name' => $_, 'value' => $record->$_)}
    $c->form->field();
    }
    </code>

    Easy as pie!


    Karl
    aka CountZero at Perlmonks



    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    This message and any attachments are confidential. If you have received
    this message in error please delete it from your system. If you require any
    assistance please notify the sender. Thank You.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedSep 18, '06 at 4:08a
activeSep 21, '06 at 6:54a
posts8
users6
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2021 Grokbase