diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-12-13 12:41:08 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-12-13 12:41:08 +0000 |
commit | 8b4406ef5d9d22f527fb124b335812dd9136532c (patch) | |
tree | bab37bd6a04bd027f6815b13678f3fc31b131eb3 /modules/field/field.attach.inc | |
parent | d6305a6616d4e9275ae61e82334285e9fb156a62 (diff) | |
download | brdo-8b4406ef5d9d22f527fb124b335812dd9136532c.tar.gz brdo-8b4406ef5d9d22f527fb124b335812dd9136532c.tar.bz2 |
- Patch #552436 by yched: validation of the number of values in field_default_validate().
Diffstat (limited to 'modules/field/field.attach.inc')
-rw-r--r-- | modules/field/field.attach.inc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/field/field.attach.inc b/modules/field/field.attach.inc index 1b55180cd..e0c745976 100644 --- a/modules/field/field.attach.inc +++ b/modules/field/field.attach.inc @@ -685,11 +685,16 @@ function field_attach_load_revision($obj_type, $objects, $options = array()) { * The type of $object; e.g. 'node' or 'user'. * @param $object * The object with fields to validate. - * @return - * Throws a FieldValidationException if validation errors are found. + * @throws FieldValidationException + * If validation errors are found, a FieldValidationException is thrown. The + * 'errors' property contains the array of errors, keyed by field name, + * language and delta. */ function field_attach_validate($obj_type, $object) { $errors = array(); + // Check generic, field-type-agnostic errors first. + _field_invoke_default('validate', $obj_type, $object, $errors); + // Check field-type specific errors. _field_invoke('validate', $obj_type, $object, $errors); // Let other modules validate the object. |