Hi!

How can I retrieve and process multivalued parameter from my form under
POST query? I use last available version of Apache::Template on my
server: Apache/1.3.29 (Unix) mod_perl/1.29 mod_ssl/2.8.16 OpenSSL/0.9.7c

Mod_perl config contents:

PerlModule Apache::Template
TT2Trim             On
TT2PostChomp        On
TT2EvalPerl         On
TT2IncludePath      /path/to/my/templates
TT2PreProcess       config.tt2 header.tt2
TT2PostProcess      footer.tt2
TT2Error            error.tt2
TT2Params           uri env params uploads request
<LocationMatch '\.html$'>
  SetHandler      perl-script
  PerlHandler     Apache::Template
</LocationMatch>

When I try to retrieve multivalued parameter from params in template, it
shows only first value! If I use Template::Plugin::CGI all is ok (do not
forget REMOVE 'params' and 'uploads' from TT2Params directive!!! CGI
plugin will not work correctly if they stay in!!!).

Today, using CGI plugin is only one way to work around this bug.

I think that CGI.param and "TT2Params params uploads" interfere among
themselves and it fact need to be documented in Apache::Template.

Sample template for testing are attached to this message.

-- 
WBR, Andrey Brindeew.
"No one person can understand Perl culture completely"
(C) Larry Wall.
Title: Multivalue test
[% USE dumper(indent=0, pad="
") %] [% USE CGI %]
[% USE CGI; FOREACH par = CGI.param %]
  • [% par %]: [% SET par_val = CGI.param(par) %] [% IF par_val.size > 1 %]
      [% FOREACH mval = par_val %]
    • [% mval %]
    • [% END %]
    [% ELSE %] [% par_val %] [% END %]
  • [% END %]
    [% dumper.dump(params, uploads) %]
    1
    2
    3
    4
    5

    Attachment: pgp00000.pgp
    Description: PGP signature

    Reply via email to