Skip to content

Commit

Permalink
Item12180: Remove accidental (harmless) debugging code. Do not re-ord…
Browse files Browse the repository at this point in the history
…er options when a value is known, as it makes the presentation unpredictable. Simply mark the value as "selected".

git-svn-id: http://svn.foswiki.org/trunk@16153 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
TimotheLitt authored and TimotheLitt committed Dec 4, 2012
1 parent fc3da37 commit b92220b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions core/lib/Foswiki/Configure/Types/SELECT.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ sub prompt {
$opts =~ s/^\s+//;
$opts =~ s/\s+$//;
my $sopts = '';
if ( defined($value) ) {
$sopts .= '<option selected="selected">' . $value . '</option>';
}
else { $DB::signal = 1; $DB::signal = 1; }
foreach my $opt ( split( /,\s*/, $opts ) ) {
if ( defined($value) && $opt ne $value ) {
if ( !defined($value) || defined($value) && $opt ne $value ) {
$sopts .= '<option>' . $opt . '</option>';
}
elsif ( defined($value) && $opt eq $value ) {
$sopts .= '<option selected="selected">' . $value . '</option>';
}
}
return CGI::Select(
{
Expand Down

0 comments on commit b92220b

Please sign in to comment.