Page MenuHomePhabricator

The syntax of the {{{info}}} field is 'fragile'
Closed, ResolvedPublic

Description

Author: dan.bolser

Description:
I'm using the {{{info}}} form field to specify a page name so that I can use the #forminput; parser function. However, I find that the syntax of the field is incredibly 'fragile', which really hampers my 'debugging' process (using forminput can be confusing, especially if it requires a complex 'query strying').

For example, this fails to correctly start the page name unique number at 0:
{{{info | page name=Dummy page <unique number; start = 0>}}}

But this works (no spaces between the final equals sign):
{{{info | page name=Dummy page <unique number; start=0>}}}

Similarly, this fails to correctly set the page name at all:
{{{info | page name = Dummy page <unique number; start=0>}}}

But this works (no space between the first equals sign):
{{{info | page name=Dummy page <unique number; start=0>}}}

Finally, this fails to correctly set the page name at all:
{{{info

page name=Dummy page <unique number; start=0>

}}}

All of the above attempts around the correct syntax were tried in a effort to make the form tags more readable, making the overall form easier to understand (especially for beginners). I think white space, including newlines, is generally accepted to improve readability, and should be encouraged.

The failure of these syntax variants is inconsistent with the way templates (and often parser functions) work in MW.

Similar problems may affect the other form tags, but this has not been investigated.


Version: unspecified
Severity: enhancement

Details

Reference
bz23693

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:00 PM
bzimport set Reference to bz23693.

dan.bolser wrote:

I've been meaning to go into the code and fix these 'issues' myself, but given the length of time that I've been meaning to do this, I thought I'd better log a bug so that I don't forget!

Also, it will give me a nice item to tick off if I ever get round to looking at the code behind this ;-)

dan.bolser wrote:

Further to the above bug report, here is an example of yet more fragility...

Above we were allowed the space after the | character when specifying the
'page name' parameter of the form's info tag. However, we are apparently not allowed this space when specifying the 'create title' or 'edit title' parameters of the form's info tag:

This fails to correctly set the create or edit title of the form:
{{{info | create title=Create xoxox | edit title=Edit xoxoxo | ... }}}

But this works (no space after the | character for these parameters):
{{{info |create title=Create xoxox |edit title=Edit xoxoxo | ... }}}

Again, I like white space because I believe it increases the readability of the tag (and form).

I'd really like to write it like this:

{{{info

create title = Create xoxox
edit title = Edit xoxoxox
page name = Dummy page < unique number; start = 0 >

}}}

I believe this is now fixed. Fragile no more!