User tests: Successful: Unsuccessful:
Remove limit and change type of displayed error messages for server side validation in com_contact.
While I was working on the PR #8085, I noticed a few odd things in the com_contact controller that I would like to address with a couple of PRs.
This one is about correcting or adjusting the error handling of the core functionality.
The client side validation of com_contact will show an error message for every invalid field submitted. On the server side, the same messages are rendered as a warning and are limited to three messages per field / request.
Prerequisites
While the changes should work on any 3.x version, you should test this PR against staging.
You can easily test this if you remove the class suffix "form-validate" from the form tag in /components/com_contact/views/contact/tmpl/default_form.php on line ~17 and add the novalidate attribute at the end to prevent the browser from validating the fields as well.
Create a contact item and add a link to that form. Don't forget to either add an email address or assign the item to an existing user, otherwise the form won't show.
Submit the empty form.
The browser should reload the page because we disabled the client side validation. The expeced result would be four error messages.
Given that you've tried to submit an empty form, before the patch you will see three warnings on top of the form. For the fun of it, fill in a name and submit the form a second time. The warning for the name field is now replaced by a warning for the message field at the buttom of that warning block.
Apply the patch and once more, submit the form. Now, depending on whether or not you cleared the name field, you should see all four error messages.
Status | New | ⇒ | Pending |
Category | ⇒ | Front End com_contact |
Title |
|
I have tested this item
Works as discribed
I have tested this item
Milestone |
Added: |
||
Status | Pending | ⇒ | Ready to Commit |
Labels |
Added:
?
?
|
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-03-30 21:32:00 |
Closed_By | ⇒ | rdeutz | |
Labels |
I have tested this item✅ successfully on 8f8835d
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14496.