If you have a form that submits to the save script, and the form has multi-value parameters such as checkboxes or multi-select, only the first value is passed in case there is a redirect to the login screen, e.g. unauthenticated user.
Cause: The login form has hidden values that pass along all URL parameters. This is done with the help of QUERYPARAMS variable. That variable only took the first value.
Patch:
--- TWiki.pm (revision 23005)
+++ TWiki.pm (working copy)
@@ -4120,14 +4120,16 @@
# clean parameter names of illegal characters
$name =~ s/['"<>].*//;
# Issues multi-valued parameters as separate hiddens
- my $value = $this->{request}->param( $name );
- if ($encoding) {
- $value = _encode($encoding, $value);
+ if( $name ) {
+ foreach my $value ( $this->{request}->param( $name ) ) {
+ $value = '' unless defined $value;
+ $value = _encode( $encoding, $value ) if( $encoding );
+ my $entry = $format;
+ $entry =~ s/\$name/$name/g;
+ $entry =~ s/\$value/$value/;
+ push( @list, $entry );
+ }
}
- my $entry = $format;
- $entry =~ s/\$name/$name/g;
- $entry =~ s/\$value/$value/;
- push(@list, $entry);
}
return expandStandardEscapes(join($separator, @list));
}
--
TWiki:Main/PeterThoeny - 2012-06-21