Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In D5, element-level validation functions received a copy of the specific element they were dealing with, AND the entire form. In D6, when #validate and #element_validate were split apart, this was apparently lost. We didn't notice, as only CCK ever really made use of both params in some of its validation edge cases.
This patch just restores the third param to the element-level validators, allowing them to examine both the specific element they're responsible for, and the surrounding context, as they did in D5.
Apologies for not catching it earlier.
Comment | File | Size | Author |
---|---|---|---|
form_element_validate.patch | 1.49 KB | eaton | |
Comments
Comment #1
eaton CreditAttribution: eaton commentedJust a note: the best way to test that this patch hasn't broken anything is to submit a node form, then go to your account page and change your password. The two-field 'password verification' field implements an #element_validate function, and is where any problems with this code would show up. I ran it through that series of tests a few times and there were no problems, but others will want to take a look as well.
Comment #2
moshe weitzman CreditAttribution: moshe weitzman commentedthe patch fixes regression, adds comments, and does no harm that i can detect. my forms are validating properly.
since no modules currently use this, i also used the interrogation form of patch review. here is an IRC log.
Comment #3
Gábor HojtsyGood, my thinking was right as Moshe pasted. Committed.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.