• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic 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.

Item5283: EditTablePlugin dollar percent expansion does not work well together with SpreadSheetPlugin

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension EditTablePlugin Urgent Closed   patch 4.2.1

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

Item3890 introduced an attempt to fix the variable expansion in EditTablePlugin in the format string of EDITTABLE.

Variable $percnt gets rendered as % and $percntY%percnt becomes DONE

But before the Item3890 the $percnt was expanded when you saved the table. This is no longer the case. Now it is expanded when viewing.

But this only works with simple TWiki Variables.

Variables like %CALC% are not rendered because the SpreadSheetPlugin runs before EditTablePlugin.

When I specify a $percnt in the format of EDITTABLE is should be saved as a %-sign like it was

Then we have the old problem that % variables are expanded when you enter edit mode in EditTablePlugin which is the real problem here and that was what should have been resolved. We have 4 or 5 bug items now related to this error. We need to get this right and revert the behavour introduced in Item3890.

I did not realize that this was the behavour when Item3890 got closed - otherwise I would have protested.

Here is an example of a real application

And it has been made using the $percnt excaping.

  • Set MYNAMES = Ed, Kenneth,Benny
  • Set EXTRACT = R0:C0..R0:C-1

Startdate Stopdate Who What/Where Icon Details
3 Jan 2008 24 Jan 2008 Kenneth Vacation big grin 3 Jan 2008 - 24 Jan 2008 - Kenneth - Vacation - big grin
22 Dec 2006 2 Jan 2007 Ed X-mas Vacation smile 22 Dec 2006 - 2 Jan 2007 - Ed - X-mas Vacation - smile
30 Nov 2007   Kenneth Flexfri smile 30 Nov 2007 - Kenneth - Flexfri - smile
23 Jan 2008   Ed   big grin %CALC{ $LISTJOIN( - , $LISTIF($NOT($EXACT($item,)),$LEFT())) }%
23 Jan 2008   Ed     %CALC{ $LISTJOIN( - , $LISTIF($NOT($EXACT($item,)),$LEFT())) }%

In the above example I have an existing table where the first 3 have a correct 23 Jan 2008 - Ed . The last two row have been added using edit-table. And the result is the $percnt escaped EXTRACT. And yes it gets rendered as a %-sign but too late. The CALC is never rendered. Same happens if you put the CALC directly in the format.

I cannot find any workaround to get this working anymore. We use CALC everywhere in tables. And in most places also in the format of EDITTABLE. Making tables work like small spreadsheets is what the Spreadsheet Plugin was made for in the first place.

The above example is just one of many twikiapps that are broken and what makes it serious is that I cannot even find a work around for it.

This needs to get fixed in 4.2.1 and we should upload a fixed EditTablePlugin within days on t.o.

-- TWiki:Main.KennethLavrsen - 23 Jan 2008

Reproduce: edit table, and click Add row.

-- TWiki:Main.ArthurClemens - 04 Feb 2008

I am testing this now on TWiki 4.1. But I cannot find out how to create the desired behaviour. I cannot add =label,1, 23 Jan 2008 - Ed = to the format attribute, because it will render the first 'cell' of the format attribute.

Do you have an example that works well on TWiki 4.1?

-- TWiki:Main.ArthurClemens - 15 Mar 2008

First - thanks for looking at this bug.

The original bug report example works in 4.1. I just tried again in 4.1

You have to use the $percnt in the format attribute.

The EXTRACT detail was probably done to make the table look simpler when editing. You can also just use the CALC directly which may be a better example.

Startdate Stopdate Who What/Where Icon Details
17 Mar 2008 19 Mar 2008 Kenneth     17 Mar 2008 - 19 Mar 2008 - Kenneth
19 Mar 2008 21 Mar 2008 Benny Home cool! 19 Mar 2008 - 21 Mar 2008 - Benny - Home - cool!
21 Mar 2008 27 Mar 2008 Kenneth Out big grin 21 Mar 2008 - 27 Mar 2008 - Kenneth - Out - big grin

The above table was created in 4.1 and new rows were added in 4.1. When you add more rows in 4.2 the new %CALC is added as $percnt CALC. The percnt has to be expanded to a % when you add the row.

-- TWiki:Main.KennethLavrsen - 17 Mar 2008

I have a solution - with a configurable option: variable EXPAND_FORMAT_VARIABLES. This is the draft info for the plugin topic:

  • Variables that should be expanded on row creation. Variables can be prevented from expansion by writing $percntVARIABLE$percnt in the format attribute. But SpreadSheetPlugin's %CALC{}% is evaluated before any other variable expansions, so $percntCALC{}$percnt won't work. For these cases, list the variable names that should get expanded when a row gets created (space or comma separated, like CALC MYNAMES):
    • Set EXPAND_FORMAT_VARIABLES = CALC

Would that be clear enough?

And I have got it working too.

Hold on. I may have found a way after all to escape variables inside edit tables. Thanks to a thorough refactoring of the code.

-- TWiki:Main.ArthurClemens - 17 Mar 2008

Yes, variables are now preserved automatically. Perhaps at the cost of speed, I have not measured that.

Release note: Code refactoring; disabled table sort when editing; removed usage of $percnt to prevent variable expansion (is now done automatically); made Javascript interface aware of headers and footers, and of changerows="off"; improved feedback on row move.

-- TWiki:Main.ArthurClemens - 19 Mar 2008

There was a problem with %BR% tags.

-- TWiki:Main.ArthurClemens - 20 Mar 2008

Fixed a failing test as well (different TablePlugin attributes setting).

-- TWiki:Main.ArthurClemens - 24 Mar 2008

ItemTemplate
Summary EditTablePlugin dollar percent expansion does not work well together with SpreadSheetPlugin
ReportedBy TWiki:Main.KennethLavrsen
Codebase 4.2.1, ~twiki4
SVN Range TWiki-5.0.0, Wed, 23 Jan 2008, build 16283
AppliesTo Extension
Component EditTablePlugin
Priority Urgent
CurrentState Closed
WaitingFor

Checkins TWikirev:16544 TWikirev:16545 TWikirev:16546 TWikirev:16547 TWikirev:16554 TWikirev:16555
TargetRelease patch
ReleasedIn 4.2.1
Edit | Attach | Watch | Print version | History: r19 < r18 < r17 < r16 < r15 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r19 - 2008-08-04 - KennethLavrsen
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback