Last modified: 2013-04-12 02:22:34 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 T49147, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 47147 - Hidden 'holds template' field not hidden
Hidden 'holds template' field not hidden
Status: RESOLVED INVALID
Product: MediaWiki extensions
Classification: Unclassified
SemanticForms (Other open bugs)
REL1_20-branch
PC Linux
: Unprioritized minor (vote)
: ---
Assigned To: Yaron Koren
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-12 01:09 UTC by Al Johnson
Modified: 2013-04-12 02:22 UTC (History)
1 user (show)

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


Attachments

Description Al Johnson 2013-04-12 01:09:54 UTC
I have a "embed in field" template that has a single dropdown field that is used to "show on select" certain div sections each containing the same "for template|templateName" except with different fields but all contain a "holds template|hidden" field to hold the value of the dropdown and used in the template later.  

The problem is the dropdown template prints it's value into the free-text section for all of the hidden divs (hidden because the dropdown does not select/show them).  Each edit prints a new set of dropdown values and they interfere with the form display if the dropdown is ever changed not to mention outputting to the page itself.

Here is the simplified code:

Form
====

<div class="create-form-section-inner" id="journal-article-form">
{{{for template |CreateRefObject |sourceType={{SusFormType |sourcetype}} }}}
===Cite Journal Article===
{{{field |sourceType |holds template |hidden}}}
{| 
! | Author*:
| {{{field|journal-author}}} 
|}
{{{end template}}}
</div>

<div class="create-form-section-inner" id="news-article-form">
{{{for template |CreateRefObject |sourceType={{SusFormType |sourcetype}} }}}
===Cite News Article===
{{{field |sourceType |holds template |hidden}}}
{| 
! | News Author*:
| {{{field|news-author}}} 
|}
{{{end template}}}
</div>

{{{for template |SusFormType |embed in field=CreateRefObject[sourceType] |label=Source Type}}}
{|
! Select the type of source to cite*:
|{{{field|sourcetype|input type=dropdown |default=News Article |values=News Article, Journal Article,Video |show on select=News Article=>news-article-form; Journal Article=>journal-article-form; Video=>video-form|mandatory }}}
|}
{{{end template}}}


SusFormType Template
====================
<noinclude>
Description...
</noinclude><includeonly>{{{sourcetype|}}}</includeonly>


The documentation doesn't have any examples on how to use "embed in field" and related parameters, so I could be using them wrong, but everything works except for the combo value printouts and also it seems like if a field is declared hidden, then it should not be printing anything out on the page.
Comment 1 Al Johnson 2013-04-12 01:12:51 UTC
P.S.  I added the |sourceType={{SusFormType |sourcetype}}  part later while troubleshooting but really isn't needed (probably wrong) and without the same problem exists.
Comment 2 Al Johnson 2013-04-12 01:28:18 UTC
I should probably state what I'm trying to do.  I'm simply trying to set the "sourceType" fields with the value of the dropdown.  This works, but the dropdown value for all the hidden divs get printed out to the page.  Specifically, the whole template of the dropdown get's placed in the free-text section like so:

{{SusFormType
|sourcetype=News Article
}}
{{SusFormType
|sourcetype=Journal Article
}}{{SusFormType
|sourcetype=Journal Article
}}{{SusFormType
|sourcetype=Journal Article
}}
Comment 3 Al Johnson 2013-04-12 01:45:19 UTC
I workaround seems to be to not duplicate the form template in each div, but to keep all the selectable divs inside one template block that they pertain to.
Comment 4 Yaron Koren 2013-04-12 02:02:05 UTC
There may be other issues with the form, but one that I see right away is that you shouldn't have more than "for template" tag for the same template. Even if only one is meant to be viewed at any given time, it's still not allowed.
Comment 5 Al Johnson 2013-04-12 02:22:34 UTC
Thanks for the clarification Yaron. Closing...

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


Navigation
Links