Last modified: 2010-08-05 19:13:39 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 22960 - Mandatory fields not working with version 1.9
Mandatory fields not working with version 1.9
Product: MediaWiki extensions
Classification: Unclassified
SemanticForms (Other open bugs)
All All
: High critical (vote)
: ---
Assigned To: Yaron Koren
Depends on:
  Show dependency treegraph
Reported: 2010-03-26 11:55 UTC by Neill Mitchell
Modified: 2010-08-05 19:13 UTC (History)
1 user (show)

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


Description Neill Mitchell 2010-03-26 11:55:26 UTC

I've got SF 1.9 installed on MW 1.15.1 SMW 1.4.3. I have forms with mandatory
fields. However, if I leave those fields blank and hit Save page, it
momentarily flashes the "cannot be blank" text next to the fields, but
the save still happens!

This can be seen at

Click on "Submit an event" and then click Save page without entering any data. You see the warnings, but the page saves anyway.

Comment 1 Yaron Koren 2010-03-26 19:08:51 UTC

I can't duplicate this; I'm guessing it's happening due to some Javascript issues coming from some other extension - maybe Semantic Forms Inputs' "datepicker" input, which looks like it's generating a lot of Javascript. I'd try removing that from the form and seeing if it makes a difference. By the way, "Special:Version" is inaccessible on your wiki, which is odd - possibly a related issue?
Comment 2 Neill Mitchell 2010-03-29 10:44:37 UTC
Hi Yaron.

Turned off the datepicker. Still does it, so that is not the problem.

The site is pretty tightly locked down, but I've opened up Version for you.

Very odd problem this isn't it. 

Comment 3 Neill Mitchell 2010-07-11 10:24:37 UTC
Hi Yaron.

This is down to the Show on Select functionality. For example, if you have:

{| 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 
<div id="white">
{| class="formtable"
| {{{field|Ethnic Origin|input type=checkboxes|no 
autocomplete|property=Ethnic White}}}
<div id="black">
{| class="formtable"
| {{{field|Ethnic Origin|input type=checkboxes|no 
autocomplete|property=Ethnic Black}}}

You can save the form even if first name or surname are left blank.

If I remove the show on select stuff it won't let you save if first name or surname are left blank.
Comment 4 Neill Mitchell 2010-08-04 12:45:23 UTC
Okay, this happens if any fields are set to "hidden". All mandatory fields then stop working.

See example at

Click the Add a Mandatory Test Item button. Then in the form press save without filling in any of the fields. It momentarily flashes "Cannot be blank" next to the Title field, but saves anyway.

Form is Form:Mandatory Field Test Form.

This is quite serious if you are using the automatic page naming functionality of the form, as the fields used to create the page name can be left blank resulting in dud page names. For example, with the above form you end up with an article called ","
Comment 5 Neill Mitchell 2010-08-05 19:13:39 UTC
Okay, it happens if you have both mandatory and hidden set for a field. Obviously the mandatory is not really needed if the field is hidden, so can be removed.

I thought that was it, but I've found that the Show on Select functionality also stops mandatory fields working. It only does it if one of the Show on Select fields is set to mandatory.

{| 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. 

So bug 24111 is still valid, but I will close this one off.

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