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 Item9693 for docu changes for 1.2 and 2.0.

Item11766: templatetopics seems to go awry when there is another nested SECTION

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Urgent Waiting for Release Engine    
when you make a templatetopic like

%STARTSECTION{"exclude" type="templateonly"}%
---+!! Wiki Applications
_This page will help you create new Wiki Applications that use DataForms_

%TOC%

---++ Create a new DataForm definition topic
%STARTSECTION{"createdataform"}%
<form method="post" action="%SCRIPTURL{save}%/Sandbox" name="fastCreateDataForm" id="fastCreateDataForm">
<input type="hidden" name="topicparent" value="%SYSTEMWEB%.WikiApplications" />
<input type="hidden" name="formtemplate" value="%SYSTEMWEB%.WikiApplications" />
<input type="hidden" name="templatetopic" value="%SYSTEMWEB%.WikiApplications" />
<input type="text" name="topic" value="ItemAUTOINC1" />
 <select disabled name="web" class="foswikiSelect"> 
 <option>Sandbox</option>
%SEARCH{
    type="query"
    web="all,-Sandbox"
    topic="%WEBPREFSTOPIC%"
    "1"
    format="<option>$web</option>"
    nonoise="on"
}% </select>
<input  type="submit" value="Create topic" class="foswikiSubmit" />
</form>
%ENDSECTION{"createdataform"}%


---+++ TODO:
   * add the topic-name js to the topic textbox
   * remove Sandbox and implement http://foswiki.org/Development/AddWebParamToAllCgiScripts
   * fix http://foswiki.org/Tasks/Item11765

---
*Related Topics:* %SYSTEMWEB%.DeveloperDocumentationCategory, %SYSTEMWEB%.TemplateTopics, %SYSTEMWEB%.DataForms, %SYSTEMWEB%.FAQAnApplicationWithWikiForm
<!-- %JQREQUIRE{"chili"}% -->
%ENDSECTION{"exclude" type="templateonly"}%
%EDITTABLE{header="| *Name* | *Type* | *Size* | *Values* | *Tooltip message* | *Attributes* |" format="| text, 20, init | select, 1, text, select, select+multi, select+values, checkbox, checkbox+buttons, radio, label,textarea, date  | text, 5, 16 | text, 30, | text, 30, | checkbox, 3, H, M  |" changerows="on" }%
| *Name* | *Type* | *Size* | *Values* | *Tooltip message* | *Attributes* |
| Description | text | 80 | | Wiki Application description | |

you instead get:

Topics, %SYSTEMWEB%.DataForms, %SYSTEMWEB%.FAQAnApplicationWithWikiForm
<!-- %JQREQUIRE{"chili"}% -->

%EDITTABLE{header="| *Name* | *Type* | *Size* | *Values* | *Tooltip message* | *Attributes* |" format="| text, 20, init | select, 1, text, select, select+multi, select+values, checkbox, checkbox+buttons, radio, label,textarea, date  | text, 5, 16 | text, 30, | text, 30, | checkbox, 3, H, M  |" changerows="on" }%
| *Name* | *Type* | *Size* | *Values* | *Tooltip message* | *Attributes* |
| Description | text | 80 | | Wiki Application description | |

if i remove the STARTSECTION{"createdataform"} it works as expected.

-- SvenDowideit - 17 Apr 2012

Reproduced and analysed.

The error happens because the templateonly section is stripped from the text in expandMacrosOnTopicCreation using offsets that were calculated based on the removal of any STARTSECTION/ENDSECTION tags, but it's called on text that still has those lower-level tags in. So the offset is out by the length of those two tags. The removal of templateonly sections has to be done as a separate pass before other section macros are restored.

-- CrawfordCurrie - 25 Mar 2013

 

ItemTemplate edit

Summary templatetopics seems to go awry when there is another nested SECTION
ReportedBy SvenDowideit
Codebase trunk
SVN Range
AppliesTo Engine
Component
Priority Urgent
CurrentState Waiting for Release
WaitingFor
Checkins Foswikirev:16625 Foswikirev:16626
TargetRelease minor
ReleasedIn 1.2.0
CheckinsOnBranches trunk
trunkCheckins Foswikirev:16625 Foswikirev:16626
Release01x01Checkins
Topic revision: r6 - 26 Mar 2013, CrawfordCurrie
 
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