I'm doing an heavy usage of this module, which works great, except I need the url form input to be optional (whatever I do then with the value, empty or not, is handled by my own submit handler).
I could alter the returned form myself, but the real errors comes at validation time, required or not, your own validation function test for value, even if the element has not the #required attribute.
I did a really tiny patch, clean, that adds a $required parameter to the purl_form() function and skips the validation when the element is not required AND the value is empty.
| Comment | File | Size | Author |
|---|---|---|---|
| purl-form-required.patch | 1.41 KB | pounard |
Comments
Comment #1
pounardBetter title.
Comment #2
pounardNote that I did add an optional function parameter, and kept backward compatibility, per default, the element is #required if the parameter is not specified.
Comment #3
yhahn commentedI'll review in greater detail later but at first glance this patch looks fine.
Comment #4
yhahn commentedThanks. Committed: http://drupal.org/cvs?commit=371920
Comment #5
pounardThanks