Select type form elements have had a few new things added to them, specifically #140783: A select list without #default_value always passes form validation. In doing this we've created a method by which select forms can fail validation completely silently, and the page just appears to reload over and over w/o ever actually processing.

This is done by not setting a default_value, which will make the #required value default to TRUE, and if a title attribute is not applied to the form element, then no error class is applied, and no message is received. This is because despite the validation failing, the check is to see if the error message has anything in it (which, it's an empty string, but an error was still set). As such we should check against NULL instead. Patch to follow.

CommentFileSizeAuthor
#1 926874.patch610 byteseclipsegc

Comments

eclipsegc’s picture

StatusFileSize
new610 bytes
damien tournoud’s picture

That makes sense, but could we write some tests for it? We already have a decent test suite in FormsTestCase, but it only check error messages, not the actual class of the element.

chx’s picture

Hold this there is a discussion over the original issue.

thedavidmeister’s picture

Issue summary: View changes
Status: Needs review » Closed (duplicate)

I think this is a duplicate, and the original issue was marked as fixed.