• Do
not register here on develop.twiki.org, login with your twiki.org account.
• Use
Item7848 for generic
doc work for TWiki-6.1.1. Use
Item7851 for doc work on
extensions that are not part of a release.
More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
• Does this site look broken?. Use the LitterTray web for test cases.
I got this report by e-mail:
EditTablePlugin will not select items in dropdowns after white space has been added before or after the item text by editing the page directly.
For instance, here the last 3 rows have been changed by page edit:
and in large tables it is not immediately obvious than saving the table will cause data to be lost.
This is a fix which seems to do the job (I added 2 lines):
sub inputElement
{
...
...
if( $type eq "select" ) {
my $expandedValue = &TWiki::Func::expandCommonVariables( $theValue, $theTopic, $theWeb );
$size = 1 if $size < 1;
$text = "<select$style name=\"$theName\" size=\"$size\">";
$i = 2;
while( $i < @bits ) {
$val = $bits[$i] || "";
$valExpanded = $bitsExpanded[$i] || "";
+ $expandedValue =~ s/^[\s\*]+//; # Strip of leading white/*
+ $expandedValue =~ s/[\s\*]+$//; # Strip of trailing white/*
if( $valExpanded eq $expandedValue ) {
$text .= " <option selected=\"selected\">$val</option>";
} else {
$text .= " <option>$val</option>";
}
$i++;
}
$text .= " </select>";
$text .= saveEditCellFormat( $cellFormat, $theName );
...
I'm not fluent in Perl
so I leave it up to you to cook something better.
After saving the data then the extra white space will get lost but that doesn't look a problem. The data isn't lost anymore.
I'm still running 04 Sep 2004 $Rev: 1742 $, Plugin API version 1.025 but I've seen that the latest Dakar still has the same code.
Sorry for not taking the time to follow the "official TWiki" paths to enter this patch (is it a bug? is a fixed bug still a bug? etc.) so I'm passing it entirely to you for better or for worse.
--
PTh
- Remove whitespace from select, radio and checkbox items
- Restored topic lock if $TWiki::Plugins::VERSION < 1.1
--
PTh
Closed in 4.0.5
KJL