Item8391: selectmulti is broken because _substituteFieldTokens can't handle multi-valued parameters
Priority: Normal
Current State: Closed
Released In:
Target Release:
Applies To: Extension
Component: FormPlugin
Branches:
selectmulti
form elements only return the first value of a multi-valued list because of an incorrect assumption in
_substituteFieldTokens
that a parameter can only be single valued.
Here's the offending code in
FormPlugin.pm
:
530 $keyValues{$name} = $query->param($name);
...
535 my $value = $keyValues{$_};
536 my ( $referencedField, $meetsCondition ) =
537 _meetsCondition( $name, $value );
538 if ($meetsCondition) {
539 $value =~ s/(\$(\w+))/$keyValues{$2}/go;
540 $query->param( -name => $_, -value => $value );
541 }
In a scalar context,
param()
returns the
first parameter value.
_substituteFieldTokens
then performs substitution into that single value and sets the parameter to the result, incorrectly truncating the list.
--
DiabJerius - 16 Jan 2010
I've attached a patch which resolves this issue. It makes two assumptions:
- A multivalued field is mapped to a comma separated list when interpolated
- A condition is single valued
--
DiabJerius - 16 Jan 2010
Thanks for the fix. I will give some TLC to the plugin.
--
ArthurClemens - 16 Jan 2010
Fixed with release 1.6.
--
ArthurClemens - 26 May 2010