Bug #37928 Required Fields (Default and Custom) not validated in Anonymous Form
Submitted: 7 Jul 2008 14:15 Modified: 9 Jul 2013 8:38
Reporter: German Pizarro Email Updates:
Status: Closed Impact on me:
None 
Category:Eventum Severity:S3 (Non-critical)
Version:2.1.1 OS:Any
Assigned to: CPU Architecture:Any
Tags: anonymous, anonymous form, custom, custom fields, field, validate, Validation

[7 Jul 2008 14:15] German Pizarro
Description:
Summary and Description are required fields in Create Issue form and also in Anonymous form. Custom fields can be chosen to be required or not in Configuration.

Validation works OK in Create Issue Form, displaying javascript popup which indicate missing and then fields are marked in red.

However, using Windows XP SP2, Firefox 2, Firefox 3 and II7, from anonymous form, normal and custom required fields are NOT validated, allowing the creation of "empty" issues.

How to repeat:
-Activate anonymous form reporting for some project
-create some custom fields, allow display in anonymous form, mark them as required
-go to anonymous form, enter summary only, submit form
-issue is submited with no description (required) or required custom fields.

Suggested fix:
Verify javascript validation in anonymous form.

However, server-side validation should be used, not instead of, but in addition to client-side validation, ideally for EVERY form, but initially at least for this public form, users ARE evil...
[7 Jul 2008 14:33] German Pizarro
anonymous form, empty required fields

Attachment: anonymous.gif (image/gif, text), 45.66 KiB.

[7 Jul 2008 14:33] German Pizarro
empty issue created from anonymous form, no validation for both type of required fields

Attachment: empty_issue_created_no_validation.gif (image/gif, text), 2.41 KiB.

[7 Jul 2008 14:36] German Pizarro
Create issue form validation works fine; this discards browser cfg problem

Attachment: create_issue_validation_ok.gif (image/gif, text), 15.30 KiB.

[7 Jul 2008 14:38] German Pizarro
The validateForm function looks OK, but for some reason the javascript validation does not work in some this particular case:

<script language="JavaScript">
<!--
function validateForm(f)
{
    if (isWhitespace(f.summary.value)) {
        errors[errors.length] = new Option('Summary', 'summary');
    }
    if (isWhitespace(f.description.value)) {
        errors[errors.length] = new Option('Description', 'description');
    }
    checkCustomFields(f, required_custom_fields);
}
//-->
</script>
[8 Jul 2008 21:58] MySQL Verification Team
Thank you for the bug report.
[24 Aug 2008 18:25] German Pizarro
Possible solution proposed in user list:
http://lists.mysql.com/eventum-users/4903
[9 Jul 2013 8:38] Yngve Svendsen
Hi. Eventum is now a project independent of MySQL, and its new home (including bug tracking) is here: https://launchpad.net/eventum

I am closing this, and ask that the issue, if still relevant, be reported to the Launchpad bug tracker.