? ? Pending

User tests: Successful: Unsuccessful:

avatar matrikular
matrikular
11 Mar 2017

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.

Summary of Changes

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.

Testing Instructions

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.

Expected result

The browser should reload the page because we disabled the client side validation. The expeced result would be four error messages.

Actual result

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.

avatar matrikular matrikular - open - 11 Mar 2017
avatar matrikular matrikular - change - 11 Mar 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 11 Mar 2017
Category Front End com_contact
avatar matrikular matrikular - change - 11 Mar 2017
The description was changed
avatar matrikular matrikular - edited - 11 Mar 2017
avatar matrikular matrikular - change - 12 Mar 2017
The description was changed
avatar matrikular matrikular - edited - 12 Mar 2017
avatar matrikular matrikular - change - 12 Mar 2017
Title
Remove limit and change type of displayed error messages
Remove limit and change type of displayed error messages in com_contact
avatar matrikular matrikular - edited - 12 Mar 2017
avatar bembelimen bembelimen - test_item - 23 Mar 2017 - Tested successfully
avatar bembelimen
bembelimen - comment - 23 Mar 2017

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.

avatar kolvar kolvar - test_item - 27 Mar 2017 - Tested successfully
avatar kolvar
kolvar - comment - 27 Mar 2017

I have tested this item successfully on 8f8835d

Works as discribed


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14496.

avatar source-factory source-factory - test_item - 27 Mar 2017 - Tested successfully
avatar source-factory source-factory - test_item - 27 Mar 2017 - Not tested
avatar source-factory source-factory - test_item - 27 Mar 2017 - Tested successfully
avatar source-factory
source-factory - comment - 27 Mar 2017

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.

avatar zero-24 zero-24 - change - 27 Mar 2017
Milestone Added:
Status Pending Ready to Commit
Labels Added: ? ?
avatar rdeutz rdeutz - change - 30 Mar 2017
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
avatar rdeutz rdeutz - close - 30 Mar 2017
avatar rdeutz rdeutz - merge - 30 Mar 2017

Add a Comment

Login with GitHub to post a comment