Page MenuHomePhabricator

Show on select radiobutton field fails to function when the radio button is hidden
Closed, InvalidPublic

Description

One bug leads to a workaround, which leads to another bug... It probably makes less sense out of context, but individual bug reports were requested. This bug occurs when trying to workaround this bug:

https://bugzilla.wikimedia.org/show_bug.cgi?id=24111

Here's fields and bug comments from my form:

<!-- uploadoredit radio button field parameters "mandatory" with "default=edit" fails to prevent "None" radiobutton from appearing on edit pages. No workaround available other than hiding the entire field. --><nowiki />
<!-- uploadoredit radio button field show on select fails to function when field is hidden, so must use MediaWiki:Common.css to hide uploadoredit CSS class. --><nowiki />

<div class="hidden"> <!-- makes it so hidden uploadoredit fields below don't take up any space. Not necessary anymore to hide them with the uploadoredit CSS class, but whatever. --><nowiki />
{{{field | uploadoredit | class=uploadoredit | input type=radiobutton | values=upload, edit | default=edit | show on select=upload=>uploadfield;}}} <!-- Must duplicate this line to make buggy show on select hiding work. Workaround discovered by accident when accidentally pasting form code twice in form edit page. I don't know why it works. --><nowiki />
{{{field | uploadoredit | class=uploadoredit | input type=radiobutton | values=upload, edit | default=edit | show on select=upload=>uploadfield;}}} <!-- Must duplicate this line to make buggy show on select hiding work. Workaround discovered by accident when accidentally pasting form code twice in form edit page. I don't know why it works. --><nowiki />
</div>


Version: unspecified
Severity: normal

Details

Reference
bz32421

Event Timeline

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

You can't have the same template field more than once in a form definition, so I'm not surprised that something would break. I'm setting this to "invalid".

Looks like there was actually a bug behind this that wasn't immediately apparent as to the cause while the radio button field was hidden. I spent the day to pin it down in a demo for a new bug:

https://bugzilla.wikimedia.org/show_bug.cgi?id=32580