Last modified: 2014-02-12 23:38:03 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T36326, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 34326 - SemanticForms: Partial forms and nested templates.
SemanticForms: Partial forms and nested templates.
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
SemanticForms (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Yaron Koren
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-10 23:37 UTC by Van de Bugger
Modified: 2014-02-12 23:38 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Van de Bugger 2012-02-10 23:37:15 UTC
I have a form with nested templates:

> {{{info}}}
> {{{for template|Cache}}}
> ...Cache fields...
> {{{field|Locations|holds template}}}
> {{{end template}}}
> {{{for template|Cache/Location|multiple|embed in field=Cache[Locations]}}}
> ...Location fields...
> {{{end template}}}

Everything works good. Page code looks as expected:

> {{Cache
> |...Cache fields...
> |Locations={{Cache/Location|...}}{{Cache/Location|...}}...
> }}

I have an additional *partial* form:

> {{{info|partial form}}}
> {{{for template|Cache}}}
> <!-- No Cache fields, just next one. -->
> {{{field|Locations|holds template}}}
> {{{end template}}}
> {{{for template|Cache/Location}}}
> ...Location fields...
> {{{end template}}}

After editing a page with this partial form, all the Location templates *moved* *out* of Cache, while Locations field receives strange value:

> {{Cache
> |...Cache fields...
> |Locations=@replace_Cache___Locations@
> }}
> {{Cache/Location|...}}{{Cache/Location|...}}...

That's obviously a big. Partial form should not move nested templates out of main template.

However, there is a workaround: removing "partial form" specifier from partial form definition. Such a "non-partial" form produces correct result, but I am a bit afraid -- formally it is declared as partial form, so it does not have to save non-used fields of main template, does it?
Comment 1 Van de Bugger 2012-02-10 23:42:23 UTC
> formally it is declared as partial form, so it does not have to
save non-used fields of main template, does it?

Oops, of course it should be:

formally it is NOT declared as partial form, so it does not have to
save non-used fields of main template, does it?
Comment 2 Yaron Koren 2012-02-14 19:42:49 UTC
Hi - partial forms have never really worked well, and they certainly don't work with embedded templates. My long-term plan is to get rid of them - as soon as there's support for editing sections in SF (as opposed to just templates), I think partial forms can be gotten rid of. Until then (and afterwards as well), you can definitely use "pseudo-partial" forms - regular forms that only have a small subset of the fields.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links