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

Item5738: TWiki::handleCommonTags Plugin Hook with multiple plugins

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine   Normal No Action Required   n/a  

Edit Form Data

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

Detail

I have come across a problem with variable expansion when using the EditTablePlugin in combination with the SpreadSheetPlugin. I worked around the problem by modifying TWiki::handleCommonTags, but my solution is not at all optimal. smile

Here is a simple example that illustrates the problem:

%CALC{1}%
03/26/2023

SERVERTIME is expanded properly and shows the date, but the top field shows %CALC{1}%.

If you modify lib/TWiki.pm and "repeat" the Plugin hook call to commonTagsHandler(), the top field will evaluate to 1. Is this the intended behavior, or just a limitation?

    # Plugin Hook
    $this->{plugins}->commonTagsHandler( $text, $theTopic, $theWeb, 0, $meta );
    $this->{plugins}->commonTagsHandler( $text, $theTopic, $theWeb, 0, $meta );

Of course, this is not a great solution, but in my environment I don't really care about any extra processing this requires. I briefly looked over all of the outstanding issues and could not really find any mention of a problem like this, so I thought it would be good to bring this up in case a more general solution could be worked on.

When I apply the above patch to my TWiki.pm, the example above will show the number 1 in the top field of the table, instead of %CALC{1}%

-- TWiki:Main/ChristopherTracy - 28 Jun 2008

I know your problem.

EditTablePlugin has always interpreted the TWikiVariable inside table when you edit and save resulting in the dynamic content being replaced by static.

In 4.2.0 the spec for EditTable and Table plugin was changed so the $percnt could be used to avoid the interpretation of the variables and instead the $percnt was displayed as %.

However this turned out to be a bad solution and in a later version of EditTablePlugin the original problem was finally fixed so we now have a good working feature.

The $percnt is now just a % and gets rendered AFTER the variable expansion.

The %VARIABLE% is now expanded after the TablePlugin has generated its output. But it is not expanded when you hit the edit button of an edit table.

Here is a good example of the combination of search, calc and table that now works perfectly.

%SEARCH{"AliasPlugin" format="| $percntCALC{\"$ROW()\"}$percnt | $topic |"}%

result

Search: AliasPlugin

1 Item1020
2 Item1025
3 Item1135
4 Item1163
5 Item1825
6 Item1832
7 Item1877
8 Item1879
9 Item1885
10 Item2531
11 Item2965
12 Item3043
13 Item3527
14 Item3639
15 Item4131
16 Item4618
17 Item4633
18 Item4959
19 Item5371
20 Item5573
21 Item5578
22 Item5738
23 Item807
Number of topics: 23

And here is an edit table

%EDITTABLE{ format=" | text, 10, $percntCALC{\"$ROW()\"}$percnt |", changerows="on"}%
| %CALC{"$ROW()"}% |
| %CALC{"$ROW()"}% |
| %CALC{"$ROW()"}% |
| %CALC{"$ROW()"}% |
| %CALC{"$ROW()"}% |

result

1
2
3
4
5

Note how the $percnt is used to delay the % in the format but in the cells it is not needed. And when you add a row - the $percnt is expanded correctly

I think it all works great now.

No action as this is covered on another Item

-- TWiki:Main.KennethLavrsen - 02 Aug 2008

ItemTemplate
Summary TWiki::handleCommonTags Plugin Hook with multiple plugins
ReportedBy TWiki:Main.ChristopherTracy
Codebase 4.2.0
SVN Range

AppliesTo Engine
Component

Priority Normal
CurrentState No Action Required
WaitingFor

Checkins

TargetRelease n/a
ReleasedIn

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r2 - 2008-08-02 - KennethLavrsen
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback