Subject: | Default form action broken when using TT2 |
Debian stable (etch) CGI.pm 3.38 CGI::FormBuilder v3.0501, perl v5.8.8
When using TT2 template and CGI::FormBuilder in a CGI (as opposed to
mod_perl) way with a default action, e.g.
my $form = CGI::FormBuilder->new(
template => {
type=> 'TT2',
template => 'contact.tt',
variable => 'contact' },
name => 'contactform',
id => 'contactform',
fields => \@formfields ,
method => 'post',
);
the action in the form tag loses any path relative to the baseurl of the
site e.g. <form action="fred.cgi" ...> instead of <form
action="/cgi/fred.cgi" ....>. Results in an HTTP 404.
Workaround: Specifying action=> $ENV{SCRIPT_NAME} fixes the problem.