• 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.

Item6348: EditTable evaluates SET variables, changing code

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension EditTable Normal Confirmed   n/a  

Edit Form Data

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

Detail

EditTable evaluates SET variables, changing underlying TWiki page code .

Worse, it does this in label formatted fields, which sdhould be left alone.

Here's my code

At the top of the page, I have instructions to the user, wrapped in an HTML comment:

<!--
To add a new row (a new Project) start by copying and pasting the sample row below:

| _Project_ |  %CALC{$SET(CI,Project20XXXXXXX)}% [[%CALC{$GET(CI)}%" }%][%ICON{viewtopic}%]] | %FORMFIELD{"Priority" topic="%CALC{$GET(CI)}%" }% | %FORMFIELD{"Status" topic="%CALC{$GET(CI)}%" }% | | *&nbsp;* | | | |
-->

Then comes the table which uses CALC, SET, and GET. This works perfectly UNTIL editing.

Before Editing

%EDITTABLE{format="label|label|label|label|date|label|text|"}%
| *Project* | *Link* | *Priority* | *Status* | *Date* | *&nbsp;* | *A* | *B* | *C* | 
| *Project Flywheel* | %CALC{$SET(CI,Projects200910r0)}% [[%CALC{$GET(CI)}%][%ICON{viewtopic}%]] | %FORMFIELD{"Priority" topic="%CALC{$GET(CI)}%" }% | %FORMFIELD{"Status" topic="%CALC{$GET(CI)}%" }% | 21 December 2009 | *&nbsp;* | q | q | q |

After Editing:

%EDITTABLE{format="label|label|label|label|date|label|text|"}%
| *Project* | *Link* | *Priority* | *Status* | *Date* | *&nbsp;* | *A* | *B* | *C* |
| *Project Flywheel* | %CALC{$SET(CI,Projects200910r0)}% [[%CALC{$GET(CI)}%][%ICON{viewtopic}%]] | %FORMFIELD{"Priority" topic="Project20XXXXXXX" }% | %FORMFIELD{"Status" topic="Project20XXXXXXX" }% | 21 December 2009 | *&nbsp;* | q | q | q |
<nop>

Issues

  1. After editing, EditTable has changed the code, replacing all instances of %CALC{$GET(CI)}% with the literal string Project20XXXXXXX, taken from the first setting of CI (in the instructional comment.)

  1. Not only has it done a global replacement, it's done this in fields marked as label.

  1. If EditTable had to do replacement of %CALC{$GET(CI)}%, it could at least have used the current / most recentt value of CI as set on the same line. frown

reproduced at twiki.org

-- TWiki:Main/VickiBrown - 13 Oct 2009

spent some time on this issue - i was able to recreate. yup, its a bug in edittableplugin

-- TWiki:Main.SopanShewale - 25 May 2010

ItemTemplate
Summary EditTable evaluates SET variables, changing code
ReportedBy TWiki:Main.VickiBrown
Codebase ~twiki4
SVN Range TWiki-5.0.0, Sun, 27 Sep 2009, build 18153
AppliesTo Extension
Component EditTable
Priority Normal
CurrentState Confirmed
WaitingFor

Checkins

TargetRelease n/a
ReleasedIn

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r2 - 2010-05-25 - SopanShewale
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback