Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
forms system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Feb 2017 at 22:57 UTC
Updated:
5 Jun 2019 at 11:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
amit0212 commentedThis does not completely solve the issue. The errors are displayed in the order form_set_error() is called. This is controlled by the hook invocation order and what order the validate hooks look at the fields. This patch does of course solve the issue for empty required fields and any modules which walk through the fields in form order.
Patch
Comment #3
hgoto commented@amit0212 thank you for your review. I guess you have reviewed the patch #4 in the original issue. But the newest patch for D7 is #52 and it's better to start with it.
Comment #4
hgoto commentedHere is a patch. I updated the patch #52 in the original issue with a test like one for D8.
The method name of the test case is
testValidationErrorMessagesSortedWithWeight()which is same as I suggested comment #72 in the original issue.I'd like someone to review the patch.
Comment #7
hgoto commentedIn the patch #4, I used array bracket syntax which is not allowed in PHP 5.3 by mistake...
I updated the patch and hope this would pass the tests without CI error.
Comment #8
hgoto commentedInterdiff.
Comment #10
hgoto commentedThe test failed and passed as expected!
Comment #11
quotesbro commented@hgoto thanks for the patch! It works for me.
I changed field titles to make the test more readable.
Comment #12
quotesbro commented