Page MenuHomePhabricator

Form definition without newlines causes incorrect display of multiple-instance templates
Open, LowPublicBUG REPORT

Description


Version: unspecified
Severity: trivial

Details

Reference
bz35554

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 12:10 AM
bzimport set Reference to bz35554.

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>

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?

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.

So - does this happen regardless of what's in the "^form" template?

Also, why does the bug report title mention "multiple templates"?

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

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?

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!

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?

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

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.

Aklapper triaged this task as Low priority.Feb 4 2022, 8:07 PM
Aklapper changed the subtype of this task from "Task" to "Bug Report".