You are here: Foswiki>Tasks Web>Item13906 (08 Feb 2016, GeorgeClark)Edit Attach

Item13906: EditRowPlugin create table row without spaces.

pencil
Priority: Normal
Current State: Closed
Released In: 2.1.0
Target Release: minor
Applies To: Engine
Component: EditRowPlugin, FoswikiTables
Branches: master Release02x00 Item13897
Reported By: StanleyTweedle
Waiting For:
Last Change By: GeorgeClark
EditRowPlugin create row like ||||| without spaces on empty cells . But wysiwyg editor requires spaces | | | | | | | .

-- StanleyTweedle - 28 Dec 2015

Can you check http://trunk.foswiki.org/Sandbox/TestItem13906 I'm unable to recreate the issue. Adding a row, click save and view raw topic and the columns are spaced.

-- GeorgeClark - 30 Dec 2015

Ок. Just add more rows and options and it present. (This table import from my twiki).

http://trunk.foswiki.org/Sandbox/TestItem13906

-- StanleyTweedle - 30 Dec 2015

Okay. Changing to confirmed. No idea how to fix it though.

-- GeorgeClark - 31 Dec 2015

/lib/Foswiki/Tables/Table.pm

engine problem

721 $initial = '' unless defined $initial;

change to or add before

$initial ||='  ';

solved problem.

-- StanleyTweedle - 01 Jan 2016

Came up with the following patch.
diff --git a/core/lib/Foswiki/Tables/Table.pm b/core/lib/Foswiki/Tables/Table.pm
index f8bbebf..960d320 100644
--- a/core/lib/Foswiki/Tables/Table.pm
+++ b/core/lib/Foswiki/Tables/Table.pm
@@ -717,7 +717,7 @@ sub parseFormat {
         elsif ( $type =~ m/^(radio|select|checkbox)/ && scalar(@values) ) {
             $initial = $values[0];
         }
-        $initial = '' unless defined $initial;
+        $initial = ' ' unless ( defined $initial && length($initial) > 0 );
 
         @values = map { s/^\s*//; s/\s*$//; $_ } @values;
         push(
Crawford, could you check this out. It break TableTests - I had to change one assert.

-- GeorgeClark - 03 Jan 2016

This is related to already resolved Item13662. It is worth looking at to make sure noone reverts a fix or introduce the trouble Crawford has concerns about.

I just noticed this one. I did not test the fix. it is probably OK

-- KennethLavrsen - 06 Jan 2016
 
Topic revision: r10 - 08 Feb 2016, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy