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

Item3890: EDITTABLE expands variables in table cells

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension EditTablePlugin Normal Closed   minor 4.2.0

Edit Form Data

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

Detail

EDITTABLE expands variables in table cells; it would be a lot nicer from a UI point of view if it left the expansion to TWiki when it renders the page.

example:

My page defines a variable for a graphic dingbat

   * Set CHK = <img src="%ICONURL{checkmark}%" alt="check" width="16" height="16" />

I then place check into a table cell in Edit Table mode.

The next time I click the Edit button for the table, the cell contains

   <img src="%ICONURL{checkmark}%" alt="check" width="16" height="16" />

That's hard to read and difficult to edit (e.g. to put text next to the dingbat) , especially if I set up the table a relatively narrow "text" format for that field! After all, I should only need a few characters (wrong).

-- TWiki:Main/VickiBrown - 13 Apr 2007

This problem has been reported a gzillion times on the TWiki:Plugins.EditTablePluginDev topic and clearly annoying many.

Not an urgent show stopper bug but for sure a bug many would cheer if it was resolved.

The problem is that the current functionality will have to be separated on more handlers (i did a simple trial which you can reed in the Dev topic that shows that you cannot just change to an earlier run plugin handler).

The change will also be breaking compatibility but I doubt many people has made applications that take advantage of the current functionality. I for sure have not seen anyone do it on my installations, but many have reported annoyance that a simple DONE (%Y%) gets expanded into a long img type html string. And as an admin you fear the day you have change the domain name of the server and have to correct all those hardcoded URLs for simple DONE.

My evaluation is that this can be fixed as a bug fix and that the compatibility problem can be ignored.

But again. No release blocker. Just a big wish from many.

And in summary - the bug is that EditTablePlugin - expands TWiki Variables inside tables when you edit them. It happens the moment you hit the edit button and not during the save process. So you can save a TWiki Variable but the minute you edit again the TWiki Variables get expanded and saved as their static value instead.

There is a list of TWiki Variables (same as in templates) that can be used in the EDITTABLE definition as default values when adding a new row which get expanded when the row is added even when it is a label. These are variables for time stamps and Wiki Name. It is important that after a fix is applied to this bug, that these variables are still expanded like today. Otherwise that will break many Edit Table based TWiki apps.

-- TWiki:Main.KennethLavrsen - 19 Oct 2007

Item3958, Item4852 and Item4170 are duplicates of this item

-- TWiki:Main.KennethLavrsen - 19 Oct 2007

if some variables must be expanded and some not, either type must be tagged as such. And to not break compatibility I suggest that the non-expanding variables must be tagged. For instance by using a new syntax /%Y%/. In the beforeCommonTagsHandler any variable inside a table row could be protected.

-- TWiki:Main.ArthurClemens - 19 Oct 2007

I was wrong.

It is all variables that get expanded when defined as initial value. I mixed up a feature from CommentPlugin that uses templates.

See EditTablePlugin the section Initial Value.

All we have to make sure when fixing is that variables are still expanded when adding rows. When you do not want this to happen you follow the instructions in EditTablePlugin using $percnt etc.

But all variables must never be expanded when you edit the table.

-- TWiki:Main.KennethLavrsen -- 19 Oct 2007

For info EditRowPlugin has same problem. It also expands twiki variables when editing again

-- TWiki:Main.KennethLavrsen - 19 Oct 2007

I have created this rule: a variable that is escaped is only expanded on view, not on edit or save. In edit mode you will see

$percntY$percnt

but this will be rendered as DONE in view mode.

Test:


| $percntY$percnt | WebHome | %$nopHOMETOPIC% |

-- TWiki:Main.ArthurClemens - 19 Oct 2007

On IRC we decided to show variables as %<nop>Y% instead of $percntY$percnt. This means that the syntax in the header will be different from the edit mode.

-- TWiki:Main.ArthurClemens - 20 Oct 2007

Note to self: this needs to be documented.

-- TWiki:Main.ArthurClemens - 19 Nov 2007

I thought I had implemented this, but it doesn't work.

-- TWiki:Main.ArthurClemens - 19 Nov 2007

I can confirm that it did work for a short time and is broken again.

We really need this fixed.

test case

head head2
1 2
DONE NEW
%Y Cell above should not be expanded %N Cell above should not be expanded

-- TWiki:Main.KennethLavrsen - 23 Nov 2007

The issue is still the same.

The plugin saves the %<nopY% and %N% correctly. It is when you hit edit again that the expanded value is put in the form. And then when you save again the variables are gone and replaced by the expanded value. So it is the phase when you hit the edit button that is broken. Not the save

-- TWiki:Main.KennethLavrsen - 23 Nov 2007

It has been fixed by now.

head head2
1 2
DONE Cell above should not be expanded NEW Cell above should not be expanded

-- TWiki:Main.ArthurClemens - 17 Dec 2007

Still not satisfactory. My most recent solution is to let escaped variables in the table stay escaped, like $percntY$percnt, and to render these as %Y% (displayed as DONE).

-- TWiki:Main.ArthurClemens - 22 Dec 2007

ItemTemplate
Summary EDITTABLE expands variables in table cells
ReportedBy TWiki:Main.VickiBrown
Codebase

SVN Range TWiki-4.1.2, Fri, 13 Apr 2007, build 13369
AppliesTo Extension
Component EditTablePlugin
Priority Normal
CurrentState Closed
WaitingFor

Checkins TWikirev:15353 TWikirev:15354 TWikirev:16087 TWikirev:16088
TargetRelease minor
ReleasedIn 4.2.0
Edit | Attach | Watch | Print version | History: r19 < r18 < r17 < r16 < r15 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r19 - 2008-01-22 - 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