NOTE: If you are a developer, please use a private wiki based on foswiki/trunk on a daily base ...or use trunk.foswiki.org to view this page for some minimal testing.
Use Item9693 for docu changes for 1.2 and 2.0.

Item10978: Select element created with select+values does not handle empty select string

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Normal Closed Engine    
If the select value of the select+values part is an empty string (perhaps because of a SEARCH), the select HTML element shows the value part.

With this data table:

Name Type Size Values Tooltip message Attributes
wordType select+values 1 ,=1,Two=2 Type of word  

You will get this select element:

Instead of
<option value="=1" class="foswikiOption">=1</option>

the option should be
<option value="1" class="foswikiOption"></option>

The parsing of the select+values is done in Form::Select, line 58. The current regex is:
if ( $val =~ /^(.*?[^\\])=(.*)$/ ) {
    $str = TAINT($1);

but I believe it should be
if ( $val =~ /^(.*[^\\])*=(.*)$/ ) {
    $str = TAINT($1) || '';

-- ArthurClemens - 17 Jul 2011

Updated unit test and committed.

-- ArthurClemens - 17 Jul 2011

 

ItemTemplate edit

Summary Select element created with select+values does not handle empty select string
ReportedBy ArthurClemens
Codebase 1.1.3, trunk
SVN Range
AppliesTo Engine
Component
Priority Normal
CurrentState Closed
WaitingFor
Checkins Foswikirev:12178 Foswikirev:12179 Foswikirev:12180
TargetRelease patch
ReleasedIn 1.1.4
Topic revision: r5 - 17 Dec 2011, GeorgeClark
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons LicenseGet Foswiki at sourceforge.net. Fast, secure and Free Open Source software downloads