Item1974: Section type "expandvariables" not working consistently for included templates

pencil
Priority: Normal
Current State: No Action Required
Released In:
Target Release: n/a
Applies To: Engine
Component: foswiki.pm
Branches:
Reported By: AndrewMould
Waiting For:
Last Change By: CrawfordCurrie
Ran across this while trying to implement a nested-template system. If the new topic template INCLUDEs a second-level template within a section marked as "type=expandvariables" then I observed the following:

  • The nested template is expanded out in the new topic, as you'd hope, but incorrectly
  • Macros in the nested template are processed inconsistently / wrongly:
    • NOP is translated to <nop> - I'd expect it to be removed, as is normal for topic creation
    • param is displayed without translation (I just tried this to see if it was a workround)
    • URLPARAM is expanded correctly

Simplified example:
(MainTemplate)
%STARTSECTION{type="expandvariables" param="TI"}%
%INCLUDE{"NestedTemplate" section="%URLPARAM{"subtemplate"}%"}%
%ENDSECTION{type="expandvariables"}%

(Nested Template)
%STARTSECTION{"Sub1"}%
%ACTI%NOP%ON{who="%URLPARAM{"assignee"}%"}% Action 1%ENDACTION% 
%AC%param%ON{who="%URLPARAM{"assignee"}%"}% Action 2%ENDACTION% 
%ENDSECTION{"Sub1"}%

Resulting new topic:
%ACTI<nop>ON{who="someone"}% Action 1%ENDACTION% 
%AC%param%ON{who="someone"}% Action 2%ENDACTION% 

ie (in my case) the actions don't get created in the new topic because the escaping is not working correctly.

-- AndrewMould - 26 Aug 2009

AFAICT it's working as per spec. The NOP in the nested template expands to <nop> which is what I'd expect. The parameters are handled correctly.

Given that this is nearly a year old, closing it no-action.

-- CrawfordCurrie - 25 Aug 2010

ItemTemplate edit

Summary Section type "expandvariables" not working consistently for included templates
ReportedBy AndrewMould
Codebase 1.0.6
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Engine
Component foswiki.pm
Priority Normal
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn
Topic revision: r2 - 25 Aug 2010, CrawfordCurrie
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