Last modified: 2014-02-12 23:38:17 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 T37554, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 35554 - Form definition without newlines causes incorrect display of multiple-instance templates
Form definition without newlines causes incorrect display of multiple-instanc...
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
SemanticForms (Other open bugs)
unspecified
All All
: Unprioritized trivial (vote)
: ---
Assigned To: Yaron Koren
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-28 06:19 UTC by John McClure
Modified: 2014-02-12 23:38 UTC (History)
0 users

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


Attachments

Description John McClure 2012-03-28 06:19:02 UTC

    
Comment 1 John McClure 2012-03-28 06:22:12 UTC
This causes misformatting of an add-another button and its fieldset:
<includeonly>{{^form
|form=Publication
}}</includeonly>

This corrects the problem somehow:
<includeonly>
<span style="display:none">anything</span>
{{^form
|form=Publication
}}</includeonly>
Comment 2 Yaron Koren 2012-03-28 10:25:57 UTC
This bug report needs to be more specific. I assume that template call is within the form definition? And surely the bug depends on what's contained within the "^form" template? Or does it happen regardless of what that template holds?
Comment 3 John McClure 2012-03-28 18:06:05 UTC
More information: Instead of "<span style="display:none">anything</span>" I inserted "<nowiki/>" and got the same result - all misformatting corrected. So it seems MW software needs to establish the caller's context first (during which SF has an oppty to establish its own context?), before the {{^form}} template is invoked? 

Yep the template call is in the form definition. Recall that I placed artifacts on referata.
Comment 4 Yaron Koren 2012-03-28 21:22:30 UTC
So - does this happen regardless of what's in the "^form" template?

Also, why does the bug report title mention "multiple templates"?
Comment 5 John McClure 2012-03-29 19:18:53 UTC
Hi Yaron - the misformatting occurs when the template:^form contains multiple form templates, no other time. That's why multiple templates are mentioned. This occurs only when a MW template is invoked from a form and hence that's why MW templates are mentioned in the title. Again, if the MW template invocation is preceded by NO content on a form's page prior to the invocation, the misformatting occurs. The example code on referata attests to this situation. Hope that helps you. Thanks - john
Comment 6 Yaron Koren 2012-03-29 19:28:59 UTC
This form you created is currently working fine, no?

http://smw.referata.com/wiki/Form:Hypergrove

If so, can you change it to demonstrate the bug?
Comment 7 John McClure 2012-03-30 01:30:43 UTC
yes it is, because I added content prior to the {{^form}} call. I just removed that content, and you can see the error plainly. Thanks!
Comment 8 Yaron Koren 2012-03-30 02:07:00 UTC
Okay, it looks like the issue is that you put all of the form template (i.e., "^form") on one line, by commenting out all the line breaks. If I take out the comment tags before the "wikiPreview" div, thus putting it on its own line, the problem goes away. Why did you comment out all the line breaks, anyway?
Comment 9 John McClure 2012-03-30 17:30:08 UTC
original:
__NOTOC__<!--
-->&#123;&#123;&#123;info&#124;onlyinclude free text&#124;create title=create &#124;edit title=edit&#125;&#125;&#125;
<div id="wikiPreview" style="display: none; padding-bottom: 25px; margin-bottom: 25px; border-bottom: 1px solid #AAAAAA;"></div>

modified:
__NOTOC__&#123;&#123;&#123;info&#124;onlyinclude free text&#124;create title=create &#124;edit title=edit&#125;&#125;&#125;
<div id="wikiPreview" style="display: none; padding-bottom: 25px; margin-bottom: 25px; border-bottom: 1px solid #AAAAAA;"></div>

Yes this is a(nother) workaround. I also removed __NOTOC__ so that the {{{info}}} tag is the first content in the template, and it's still working. So you're right, the comment is causing a problem somehow.

I comment the linebreaks because I want to know/control what whitespace is operative in my calls, not the parser which I think handles whitespace somewhat unpredictably. 

regards, john
Comment 10 Yaron Koren 2012-03-30 20:23:08 UTC
Okay - I'm changing the title of this bug to "Form definition without newlines causes incorrect display of multiple-instance templates", for clarity. I don't believe that this has anything to do with the fact that the form definition is being stored in a template.
Comment 11 Yaron Koren 2013-12-23 16:46:30 UTC
Changing severity to "trivial".

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


Navigation
Links