https://bugzilla.wikimedia.org/show_bug.cgi?id=16810
Summary: Validation doesn't work for multiple template mandatory
fields with preloaded data
Product: MediaWiki extensions
Version: any
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: Normal
Component: Semantic Forms
AssignedTo: [email protected]
ReportedBy: [email protected]
Created an attachment (id=5626)
--> (https://bugzilla.wikimedia.org/attachment.cgi?id=5626)
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.
--
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l