Last modified: 2009-01-05 19:07:00 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 T18810, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 16810 - Validation doesn't work for multiple template mandatory fields with preloaded data
Validation doesn't work for multiple template mandatory fields with preloaded...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
SemanticForms (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Yaron Koren
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-27 16:42 UTC by Serhiy Kutnii
Modified: 2009-01-05 19:07 UTC (History)
0 users

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


Attachments
The patch changes the SF_FormPrinter::formHTML() method making it to produce the "validate_mandatory_field" call for multiple-instanced template fields if they contain preloaded data. (929 bytes, patch)
2008-12-27 16:42 UTC, Serhiy Kutnii
Details

Description Serhiy Kutnii 2008-12-27 16:42:52 UTC
Created attachment 5626 [details]
The patch changes the SF_FormPrinter::formHTML() method making it to produce the "validate_mandatory_field" call for multiple-instanced template fields if they contain preloaded data.

Steps to reproduce

1. Create a form with at least 1 multiple template containing at least 1 mandatory field for some parameter of the multiple template.
2. Edit some page with the form. Add one instance of the multiple template enter some value into the mandatory field and submit the form.
3. Edit the page with the form once more. Delete the value you have added in the previous step from the mandatory field leave the field blank and submit the form - it should not be submitted and an error message should be produced, but the form can be submitted actually. The template receives an empty parameter which might be not good. 

The reason is that while the fields containing preloaded data have the ids of the form "input_<number>" regardless of whether they correspond to a multiple template instance or not validation calls for these fields are "validate_multiple_mandatory_fields(<number>)" and the "validate_multiple_mandatory_fields" function looks for fields with ids of the form "input_<instance_num>_<field_num>" being thus not able to locate the actual validation target.
Comment 1 Yaron Koren 2009-01-05 19:07:00 UTC
Thanks for the patch! This was added in version 1.4.1.

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


Navigation
Links