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

Item5146: EDITTABLE plays Too nicely with SEARCH

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension EditTablePlugin Enhancement New TWiki:Main.VickiBrown n/a  

Edit Form Data

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

Detail

I ran into an "interesting" interaction between EDITTABLE and SEARCH.

Let's say you have a table like this

| *Project* | *Assignee* | *Launch Date* |  |
%SEARCH{search="META:FIELD.*?AssignedTo.*?VickiBrown.*" topic="Projects_.*"   format="| $formfield(ProjectName) | $formfield(AssignedTo)  | $formfield(LaunchDate) |" }%

It returns all Project pages where AssignedTo is VickiBrown. Standard TWiki Forms search. No problem.

Then, lets say someone edits the page.

%EDITTABLE{}%
| *Project* | *Assignee* | *Launch Date* |  |
%SEARCH{search="META:FIELD.*?AssignedTo.*?VickiBrown.*" topic="Projects_.*"   format="| $formfield(ProjectName) | $formfield(AssignedTo)  | $formfield(LaunchDate) |" }%

What I expected to happen:

There is only one "real" table row here. Everything else is virtual, ephemeral, dynamic. I would expect clicking the edit button to show a table with no rows except the header and the ability to add one or more rows above the Search results.

What actually does happen:

EDITTABLE merrily picks up the Search results and presents them as an editable table. When you save, it writes these (now static) rows into the page. They are immediately followed by the Search results.

If SEARCH returns four rows, following an edit, you now see 8. Then 12. Ever recursively down the Rabbit Hole we plunge. Yargh!

I realize that the quick response is "don't hold your arm like that". But it would be nice if TWiki (in the person of EditTablePlugin) could help protect the naive user from his own error by not picking up the "dynamic" rows returned by Search!

-- TWiki:Main.VickyBrown - 18 Dec 2007

This can actually be (mis)used as feature for capturing search results. wink

-- TWiki:Main.FranzJosefGigler - 18 Dec 2007

Do you have any idea yourself how we could 'protect' the SEARCH variable? I don't find it very obvious. footerrows cannot be used as the number will vary with the search. %EDITTABLESTARTPROTECT% and %EDITTABLESTOPPROTECT% looks ugly. The plugin cannot detect that the SEARCH should be protected by itself. Moreover it may be intended.

-- TWiki:Main.ArthurClemens - 20 Dec 2007

Franz - agreed. But my guess is that intentional capture is less likely than misuse. The people at my company simply didn't realize what they were doing.

Arthur - If it were me, I would think that EDITTABLE and SEARCH would need to cooperate. So, by defaulkt, SEARCH would produce some hidden information, perhaps in the form of an HTML comment, that EDITTABLE would see and use to ignore that section of the table. A SEARCH parameter could be used to allow editing of SEARCH results for those who understood the ramifications.

-- TWiki:Main.VickiBrown - 22 Dec 2007

That would mean there need to be a PROTECT variable. I favor TWiki syntax over html comments.

-- TWiki:Main.ArthurClemens - 24 Dec 2007

Unsurprisingly EditRowPlugin suffers from the same disease.

I think it would be a mistake to lard the text with more variables. Much better to tell the EditTablePlugin and EditRowPlugin that only a subset of the rows in the table are editable. For example, %EDITTABLE{editablerows="1"}%. The value of editablerows could be a range expression (perhaps even disjoint?) for example %EDITTABLE{editablerows="1:3,-2:-1"}% would indicate that rows 1, 2 and 3 are editable, and so are the last 2 rows in the table (-2 and -1).

-- CrawfordCurrie - 28 Jan 2008

Looks very geeky. wink

-- TWiki:Main.FranzJosefGigler - 28 Jan 2008

ItemTemplate
Summary EDITTABLE plays Too nicely with SEARCH
ReportedBy TWiki:Main.VickiBrown
Codebase 4.0.5
SVN Range TWiki-4.3.0, Tue, 18 Dec 2007, build 16029
AppliesTo Extension
Component EditTablePlugin
Priority Enhancement
CurrentState New
WaitingFor TWiki:Main.VickiBrown
Checkins

TargetRelease n/a
ReleasedIn

Edit | Attach | Watch | Print version | History: r10 < r9 < r8 < r7 < r6 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r10 - 2008-07-26 - 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