Last modified: 2010-08-05 19:13:39 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T24960, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 22960 - Mandatory fields not working with version 1.9
Mandatory fields not working with version 1.9
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
SemanticForms (Other open bugs)
unspecified
All All
: High critical (vote)
: ---
Assigned To: Yaron Koren
:
Depends on:
Blocks:
  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: ---


Attachments

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

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 www.prescientsoftware.co.uk/schoolgate_dev

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

Cheers
Neill.
Comment 1 Yaron Koren 2010-03-26 19:08:51 UTC
Hi,

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. 

Cheers
Neill.
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 
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.

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 http://scratchpad.referata.com/wiki/Mandatory_Field_Test

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.

e.g.:
{| 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.


Navigation
Links