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)}%" }% | | * * | | | |
-->
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* | * * | *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 | * * | q | q | q |
After Editing:
%EDITTABLE{format="label|label|label|label|date|label|text|"}%
| *Project* | *Link* | *Priority* | *Status* | *Date* | * * | *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 | * * | q | q | q |
<nop>
Issues
- 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.)
- Not only has it done a global replacement, it's done this in fields marked as
label
.
- 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.
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