summaryrefslogtreecommitdiff
path: root/modules/field/field.attach.inc
diff options
context:
space:
mode:
Diffstat (limited to 'modules/field/field.attach.inc')
-rw-r--r--modules/field/field.attach.inc9
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.