arrays in FORM

Albert Ting altlst at sonic.net
Fri Apr 1 22:23:27 UTC 2005


Thanks for the tip.  I've updated my patch accordingly.

This is regarding feature #283695, where one can permanently highlight/mark
individual bug comments.

David Miller writes:
> From: David Miller <justdave at bugzilla.org>
> To: developers at bugzilla.org
> Subject: Re: arrays in FORM
> Date: Fri, 01 Apr 2005 12:34:58 -0800
> 
> Albert Ting wrote:
> > If I have something like below in a template:
> > 
> >      <input type=checkbox name=choices value="1">1
> >      <input type=checkbox name=choices value="2">2
> >      <input type=checkbox name=choices value="3">3
> >      <input type=checkbox name=choices value="4">4
> > 
> > Is there a way to get the data back as an array, something like:
> > 
> >     @{$::FORM{'choices'}}
> > 
> > Best I can tell, FORM only holds strings.
> 
> $::FORM is deprecated and getting removed (and will probably actually be 
> gone in 2.20 if we get lucky).  Don't use it unless you have an old 
> enough version of Bugzilla that doesn't have Bugzilla->cgi available.
> 
> If you have that old of a Bugzilla, then %FORM holds single strings, 
> which anything that passed multiple values concatenated together. 
> %MFORM contains arrays of all of the values for anything that passed 
> multiple.
> 
> If you have Bugzilla->cgi available, you can get multiple values with 
> something like
> 
> my @array = Bugzilla->cgi->param('paramname');
> 
> You can of course do:
> 
> my $cgi = Bugzilla->cgi;
> 
> first and then use $cgi if you want (if the file you're working in 
> doesn't already do that).
> 




More information about the developers mailing list