You are here: Foswiki>Tasks Web>Item11766 (05 Jul 2015, GeorgeClark)Edit Attach

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

pencil
Priority: Urgent
Current State: Closed
Released In: 2.0.0
Target Release: major
Applies To: Engine
Component:
Branches: trunk
Reported By: SvenDowideit
Waiting For:
Last Change By: GeorgeClark
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 Closed
WaitingFor
Checkins distro:e0e2db98bae5 distro:f3250cbcf858
TargetRelease major
ReleasedIn 2.0.0
CheckinsOnBranches trunk
trunkCheckins distro:e0e2db98bae5 distro:f3250cbcf858
Release01x01Checkins
Topic revision: r8 - 05 Jul 2015, GeorgeClark
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