NOTE: If you are a developer, please use a private wiki based on foswiki/trunk on a daily base ...or use trunk.foswiki.org to view this page for some minimal testing.
Use Item11383 for general documentation changes for release 1.1.5. Use Item9693 for docu changes for release 2.0.

Item5913: EditTablePlugin does not update label fields upon save

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Enhancement No Action Required Extension EditTablePlugin  
Ran into a new interesting bug:

EditTablePlugin is very nice in that you can combine it with other plugins that generate tables to then edit the resultant table structure and have the edited result saved into the topic. In other words, the table to be edited may be the result of another TWiki tag, rather than have been loaded from the topic. Examples of this are when the table can be optionally retrieved from somewhere other than the saved topic (e.g., a web site, a data base), but we then want to be able to edit the table and save into the topic. This works very well, almost. However, there is one gotcha.

In order to explain this better, let me review the algorithm this plugin uses when saving:
  1. if it is determined that a save button was pressed, call processText again in saveMode
  2. now load the saved text for the topic
  3. merge the text from the query with the saved text in the topic for the edited table:
    1. for each row in the saved text, replace its fields with fields passed in from the query
    2. if there are added rows in the query, add these to the table
  4. save the topic

The problem occurs if the table in the query is different from the stored table, but there are fields that were formatted as labels. These fields will not be passed to the plugin for update, and consequentially will not be updated in the text. The stored values will be chosen instead.

-- TWiki:Main/ThomasWeigert - 10 Aug 2008

I am changing this to an enhancement.

And then additionally I would like to warn against implementing this without some mechanism to turn it on only when you need it.

I can imagine this feature can easily break things when people do not intend to let the plugin alter parts of a table dynamically generated.

Since this is a default plugin we should discuss this in a feature proposal with examples of how it would work.

I have considered this. And I do not like it. I will no action it for now.

Make a feature proposal if you can come up with a spec that can convince us. But for now this seems a risky deal for me.

-- KennethLavrsen - 22 Jul 2010

ItemTemplate edit

Summary EditTablePlugin does not update label fields upon save
ReportedBy TWiki:Main.ThomasWeigert
Codebase
SVN Range TWiki-5.0.0, Sun, 03 Aug 2008, build 17280
AppliesTo Extension
Component EditTablePlugin
Priority Enhancement
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn
Topic revision: r3 - 22 Jul 2010 - 21:01:37 - KennethLavrsen
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons LicenseGet Foswiki at sourceforge.net. Fast, secure and Free Open Source software downloads