Item8383: TreeBrowser produces excess output when used with empty TREEVIEW

pencil
Priority: Enhancement
Current State: New
Released In: n/a
Target Release:
Applies To: Extension
Component: TreeBrowserPlugin
Branches:
Reported By: Foswiki:Main.NeilMckett
Waiting For:
Last Change By: JeffSebastian
-- NeilMckett - 08 Jan 2010

when using the TreeBrowserPlugin as follows:


%TREEBROWSER{"thread" title="<h5>%INCLUDINGTOPIC%</h5>"}%
%TREEVIEW{startlevel="1" topic="%INCLUDINGTOPIC%"  web="%INCLUDINGWEB%" formatting="outline" format="* [[$web.$topic][$topic]]" levelprefix="   "}%
%INCLUDE{"%INCLUDINGWEB%.CreateGeneralDocPage"}%

the code in the CreateGeneralDocPage is imported into the treebrowser if the TREEVIEW is empty. The CreateGeneralDocPage code is not in the format that TreeBrowser is expecting so the tree should just be empty.

In summary TreeBrowser seems not to know when a tree has finished when a TREEVIEW tag produces no output. Perhaps some tag could be used to let the TreeBrowser know that the end of the tree has been reached eg %ENDOFTREEBROWSER%

-- Main.??? - ?? ??? ????

There is some related discussion at http://twiki.org/cgi-bin/view/Plugins/TreeBrowserPluginDev.

A quick work-around seems to be to add after the list a line with just three spaces and nothing else. This will stop TreeBrowserPlugin from processing the page further in case that there is no tree before this line.

Example:
%TREEBROWSER{...}%
%TOC%
   [a line with just 3 spaces at the beginning and nothing else]

Some other list that should not be modified
   * ...

Maybe one way to fix this would be to add some sort of negative lookahead (e.g., (?!%ENDOFTREEBROWSER%)) somewhere into the regexp that is triggering handleTreeView, possibly into the "(([\n\r]+[^\t]{1}[^\n\r]*)*?)" part.

By the way, there is a link from the TreeBrowserPlugin page to the TWiki page mentioned above, but not to the support page at foswiki.org.

-- JeffSebastian - 08 Jul 2011
 

ItemTemplate edit

Summary TreeBrowser produces excess output when used with empty TREEVIEW
ReportedBy Foswiki:Main.NeilMckett
Codebase 1.0.8
SVN Range
AppliesTo Extension
Component TreeBrowserPlugin
Priority Enhancement
CurrentState New
WaitingFor
Checkins
ReleasedIn n/a
Topic revision: r2 - 08 Jul 2011, JeffSebastian
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy