Last modified: 2011-11-22 07:28:14 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 24111 - Show on select functionality stops mandatory field checking working.
Show on select functionality stops mandatory field checking working.
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
SemanticForms (Other open bugs)
unspecified
All All
: Normal critical (vote)
: ---
Assigned To: Yaron Koren
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-24 11:58 UTC by Neill Mitchell
Modified: 2011-11-22 07:28 UTC (History)
2 users (show)

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


Attachments

Description Neill Mitchell 2010-06-24 11:58:16 UTC
Hi.

I'm using MW 1.15.3, SMW 1.5.1.1 and SF 1.9.1.

If I add show on select functionality to my forms then the mandatory field checking stops working. The form can be saved even if any of the specified mandatory fields are not filled in. For example:

{| class="formtable"
! Title:
| {{{field|Title}}}
|-
! First Name:
| {{{field|First Name|mandatory}}}
|-
! Surname:
| {{{field|Surname|mandatory}}}
|}

{| class="formtable"
! Ethnic Origin:
| | {{{field|Ethnic Origin Group|default=Not Disclosed|show on select=White=>white;Black or Black British=>black;Mixed=>mixed;Chinese=>chinese;Asian or Asian British=>asian;Other=>other}}}
|}
<div id="white">
{| class="formtable"
!
| {{{field|Ethnic Origin|input type=checkboxes|no autocomplete|property=Ethnic White}}}
|}</div>
<div id="black">
{| class="formtable"
!
| {{{field|Ethnic Origin|input type=checkboxes|no autocomplete|property=Ethnic Black}}}
|}</div>

You can save the form even if first name or surname are left blank. First Name and Surname are string properties. 

Any ideas what is causing this? It's a bit of a show stopper.

Many thanks
Neill.
Comment 1 Neill Mitchell 2010-08-05 19:14:45 UTC
After much testing I've found it only does it if one of the Show on Select fields is set to mandatory.

For example:
{| class="formtable"
! width=25%|Area Grouping:
| {{{field|Area Groups|default=None|show on select=None=>none;North and East Hampshire=>ne_hampshire;West Hampshire=>w_hampshire;South East Hampshire=>se_hampshire}}}
|}

<div id="none">
{| class="formtable"
! width=10%|Areas:
| {{{field|Areas|input type=checkboxes|no autocomplete|property=Area|mandatory}}}
|}

If any mandatory fields in the form are left blank (not just Areas), you can still save.
Comment 2 Yaron Koren 2010-08-23 22:48:14 UTC
I believe this is now fixed in version 2.0 - setting to "fixed".
Comment 3 badon 2011-11-15 01:31:40 UTC
I have found this bug again:

<!-- 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 />

<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>
Comment 4 Yaron Koren 2011-11-15 02:50:13 UTC
You can't have the same field in a form more than once; it leads to undefined behavior, so I'm not surprised that things would break. I'm setting this to "invalid".
Comment 5 badon 2011-11-15 05:29:39 UTC
Makes sense, thanks.

Changed it back to "fixed", which is what it was before I reopened it.
Comment 6 badon 2011-11-22 07:28:14 UTC
Looks like there was actually a new bug behind this, but although it produces a similar effect, I made a new report for it:

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

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


Navigation
Links