Item12075: CGI.pm won't check multivalued params specified in the query string correctly
Priority: Urgent
Current State: Closed
Released In: 1.1.6
Target Release: patch
Applies To: Engine
Component: FoswikiForm
Branches: Release01x01 trunk
On a link like this:
http://....edit/web/topic?MyMultivalueCheckboxField=Val1,Val2,Val3
values won't be checked. This has been the case since forever in Foswiki.
This changed behavior breaks a couple of wiki apps badly where you will see the following pattern:
<input type="hidden" name="MyMultiValueCheckboxField" value="%FORMFIELD{"MyMultiValueCheckboxField" topic="SomeOtherTopic"}%" />
That's pretty common.
However this works fine with recent CGI's (I am testing against 3.52):
http://....edit/web/topic?MyMultivalueCheckboxField=Val1&MyMultivalueCheckboxField=Val2,MyMultivalueCheckboxField=Val3
Problem is that Foswiki already
did parse the query string and decomposes the values accordingly into a proper list
no matter whether values are passed as a comma separated list or using multiple url params one value each.
When Foswiki::Form::Checkbox calls CGI::checkbox_group it does pass the correct values to be checked down the line.
CGI then decides to ignore this list.
... unless you add an
override => 1
to the call
Patch:
--- lib/Foswiki/Form/Checkbox.pm (revision 15382)
+++ lib/Foswiki/Form/Checkbox.pm (working copy)
@@ -138,7 +138,8 @@
-values => $this->getOptions(),
-defaults => \@defaults,
-columns => $this->{size},
- -attributes => \%attrs
+ -attributes => \%attrs,
+ -override => 1
);
if ( defined $this->{valueMap} ) {
$params{-labels} = $this->{valueMap};
--
MichaelDaum - 14 Sep 2012
Hmm. This bug seems familiar. It's not
Item11666.
Item9007/
Item9147 perhaps.
Do we need this in Select.pm too?
--
PaulHarvey - 18 Sep 2012
This is marked a release blocker. Does this need to get into 1.1.6? Is the fix safe, Why not check it in.
--
GeorgeClark - 17 Oct 2012
George, please help out on fixing things. Thanks…
--
MichaelDaum - 17 Oct 2012