Item2334: EditTable Disappears During Edit if in Same Topic as Search with Expandvariables
Priority: Normal
Current State: Confirmed
Released In: n/a
Target Release: major
If EditTable is in the same topic that includes
SEARCH which uses the expandvariables "On" option AND the search has returned at least 1 record, then when you "edit" the EDITTABLE, it disappears. The only way to change the contents of the EditTable is to now "edit" the topic.
We have uploaded an example topic and a dummy topic that it retrieves from. The example topic is
Item2334Example.
-- 12 Apr 2011 - 15:57:25 -
JoeMarandola
Confirmed - also happens on foswiki.org and trunk.foswiki.org
--
GeorgeClark - 15 Apr 2011
There is more to this bug report than the original description
There are 3 conditions that needs to be met to trigger the problem. And it took the actual example to show all 3 which is why noone could reproduce it from the original problem.
- The including topic must have a EDITTABLE table
- The including topic must have a SEARCH with expandvariables "On"
- The included topic also has an EDITTABLE table
It is the 3rd condition that we missed. If I remove the EDITTABLE from the included topic then it works fine.
What happens is that the expandvariables expands the EDITTABLE tag in the included topic before the result is included. And that goofs up all the logic behind the EDITTABLE tag.
So when you edit, my guess is that it is the table in the included topic that becomes the first table so it becomes the edited table. But since it is not really rendered it is not seen.
I think this one will be very tricky to fix without breaking something else. I am sure it is the
EditTablePlugin and not the
SEARCH that is to blame.
Not material for a 1.1.3 scope fix. But since it is a plugin thing we may fix it in a plugin release in between releases of Foswiki. But it is very ricky. Telling
EditTablePlugin to not expand itself when it happens as a result of an expandvariables from a
SEARCH is not that straightforward unless we have some context variable that says that this is what is happening. That may be a good idea to add. I am sure there are other macros from other plugins that also create unwanted actions being expanded in this context.
Joe maybe we can cook you a workaround for what you need to fix your immediate need. Is this an actual example? I may have an idea.
--
KennethLavrsen - 15 Apr 2011
Kenneth, thanks for finding this. Not sure what you mean by actual example. This one is created to demo by taking other larger topics and tailoring. Interested in your idea. Now that I understand the real problem, my first thought was to create an intermediate topic to just pull the search (with no Edit Tables in it) and then the final topic could retrieve from the intermediate topic. Not very elaborate.
--
JoeMarandola - 15 Apr 2011
Nix that last thought - probably would produce the same result.
--
JoeMarandola - 15 Apr 2011