Page MenuHomePhabricator

Semantic Forms using holds template/embed in field inside of another form breaks template output
Closed, DeclinedPublic

Description

I'm using a multiple form inside of another form and the UI works well, but the template it produces is broken. The form is like this (sorry for no link, the wiki this is on isn't publicly available):

{{{for template|Foo}}}
A: {{{field|A}}}<br/>
B: {{{field|B}}}<br/>
SpecialStuff: {{{field|Special stuff|holds template}}}<br/>
{{{for template|Specials|multiple|embed in field=Foo[SpecialStuff]}}}
X: {{{field|X}}}<br/>
Y: {{{field|Y}}}<br/>
{{{end template}}}
C: {{{field|C}}}<br/>
D: {{{field|D}}}<br/>
{{{end template}}}

This works fine and is awesome in the form UI. However, the template that it writes is problematic because the "inner template" closes out the outer one. You get something like.

{{{Foo

A=A
B=B
SpecialStuff={{Specials
X=1
Y=2}}{{Specials
X=5
Y=6}}

}}

C=C
D=D

}}

Obviously the last half is orphaned.


Version: master
Severity: normal

Details

Reference
bz49410

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:06 AM
bzimport set Reference to bz49410.

I created a version of this issue on a public URL so you can see what I mean:

http://scratch.wikiwonders.net/wiki/Special:FormEdit/Embed_test/ddd

Hi - you should never have one "for template" call inside another; that's unsupported behavior.

:-( It works really well in the Form interface.

Oh well. :) Marking this as "wontfix".