function hook_field_attach_validate

Act on field_attach_validate().

This hook is invoked after the field module has performed the operation.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity with fields to validate.

$errors: The array of errors (keyed by field name, language code, and delta) that have already been reported for the entity. The function should add its errors to this array. Each error is an associative array with the following keys and values:

  • error: An error code (should be a string prefixed with the module name).
  • message: The human-readable message to be displayed.

Related topics

1 invocation of hook_field_attach_validate()
field_attach_validate in drupal/core/modules/field/field.attach.inc
Performs field validation against the field data in an entity.

File

drupal/core/modules/field/field.api.php, line 905

Code

function hook_field_attach_validate(\Drupal\Core\Entity\EntityInterface $entity, &$errors) {

  // @todo Needs function body.
}