Item1242: EditTablePlugin cannot move rows correctly when we have footerrows

Priority: Urgent
Current State: Closed
Released In: 1.0.4
Target Release: patch
Applies To: Extension
Component: EditTablePlugin
Reported By: KennethLavrsen
Waiting For:
Last Change By: KennethLavrsen
While working with my test cases I tried to move a row up or down.

I had not expected errors here since this is mainly javascript but there is a problem I just found.

When you have a footerrow defined in the TABLE tag and you move rows up and down there is a problem in the math so when saved it is the wrong rows that are moved up and down.

Use the simple TestCaseTablesMixedTagOrder test case as an example. Edit and move up a row. Or add a row and then move it up. You end up with a mess with the footer moved up in the middle.

-- KennethLavrsen - 11 Mar 2009

Checking in updated test cases that describes the steps to reproduce this bug.

The checkins I do it not a fix.

-- KennethLavrsen - 11 Mar 2009

I have been looking into this for the whole evening, and still don't grasp what is going on.

  • Too bad you didn't tell me you were looking into it... I crashed my evening because I said I gave up, and you said you didn't look into it. So I looked deeper and deeper... -- OlivierRaginel - 12 Mar 2009

TablePlugin does not write the correct thead html in edit mode (and needs to be fixed, as well as it assumes there is always 1 header row...) but that is not the root cause.

  • Exactly. And you're saying this needs to be fixed, but this is fixed. This was the purpose of my commit from last night, distro:c84977b72e9e which fixes this, but as you mentioned, doesn't solve the issue. -- OlivierRaginel - 12 Mar 2009

This same bug occurs with TWiki plugin version 4.9.

-- ArthurClemens - 11 Mar 2009

My analysis so far:

First test without headerrows and footerrows

Let's say we have a table:

The plugin sees it like this:
row content etrow_id
1 header 1
2 a 2
3 b 3
4 c 4
5 footer 5

  • Are you sure about this? According to the JavaScript code, is assumes the etrow_id from header is first, and from footer is second, therefore I'm very surprised by your 5 there for footer. -- OlivierRaginel - 12 Mar 2009

With javascript interface, swap rows so that it looks like:

Now parsing rows:
row content etrow_id
1 header 1
2 a 3
3 b 4
4 c 2
5 footer 5

Now the same thing with headerrows and footerrows:

row content etrow_id
1 header 1
2 a 2
3 b 4
4 c 5
5 footer 3

-- ArthurClemens - 12 Mar 2009

Fixed with Item1268.

-- ArthurClemens - 15 Mar 2009

ItemTemplate edit

Summary EditTablePlugin cannot move rows correctly when we have footerrows
ReportedBy KennethLavrsen
Codebase trunk
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Extension
Component EditTablePlugin
Priority Urgent
CurrentState Closed
Checkins distro:b20396988ad0 distro:fcf16e7f83c8 distro:c84977b72e9e distro:03f8be1e49a8 distro:523ebf0cb48e
TargetRelease patch
ReleasedIn 1.0.4
Topic revision: r13 - 19 Mar 2009, KennethLavrsen
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