-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Joey Hess wrote:

> I have a form with a customised template that contains this:
> 
> <TMPL_VAR FORM-SUBMIT>
> 
> Which is expanded to all the submit buttons in previous versions of
> CGI::FormBuilder. Apparently version 3.0401 has broken this. A small
> testcase:
> 
>         #!/usr/bin/perl
>         my @fields=qw(editcontent);
>         my @buttons=("Save", "Preview", "Cancel");
> 
>         use CGI::FormBuilder;
>         my $form = CGI::FormBuilder->new(
>                 fields => [EMAIL PROTECTED],
>                 template => "foo.tmpl",
>         );
>         print $form->render(submit => [EMAIL PROTECTED]);
> 
> If I put the above template fragment into foo.tmpl and run this, it dies:
> 
> HTML::Template::param() : attempt to set parameter 'form-submit' with a 
> scalar - parameter is not a TMPL_VAR! at /usr/share/perl5/CGI/FormBuilder.pm 
> line 1337
> 
> Some debugging shows that CGI::FormBuilder::Template::HTML::render is doing
> this:
> 
>         HTML::Template::param('undef', 'form-submit', 'ARRAY(0x847a058)') 
> called
>  at /usr/local/share/perl/5.8.4/CGI/FormBuilder/Template/HTML.pm line 155
>         
> CGI::FormBuilder::Template::HTML::render('CGI::FormBuilder::Template::HT
> ML=HASH(0x86507fc)', 'CGI::FormBuilder=HASH(0x86ca734)') called at 
> /usr/local/sh
> are/perl/5.8.4/CGI/FormBuilder.pm line 1415


Hi joey!


Thanks for your bugreport (and thanks a lot for ikiwiki!).

When I run the above test it does not fail, but emits the following:

<input id="_submit" name="_submit" onclick="this.form._submit.value =
this.value;" type="submit" value="Save" /><input id="_submit_2"
name="_submit" onclick="this.form._submit.value = this.value;"
type="submit" value="Preview" /><input id="_submit_3" name="_submit"
onclick="this.form._submit.value = this.value;" type="submit"
value="Cancel" />



Your debugging seems to use a local install of Formbuilder.

Could you please double-check that the above example is correct, and in
fact errors out on your system when using the official Debian package?


Kind regards,

 - Jonas


- --
* Jonas Smedegaard - idealist og Internet-arkitekt
* Tlf.: +45 40843136  Website: http://dr.jones.dk/

 - Enden er nær: http://www.shibumi.org/eoti.htm
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFhu0in7DbMsAkQLgRAlqkAJ92Nc0o5/6Y6wTVgoQtSQIl16APpwCdEg4P
UtKSsNf5dc0KAX/WpD+D59Q=
=F3HS
-----END PGP SIGNATURE-----

Reply via email to