function entity_form_field_validate
Attaches field API validation to entity forms.
6 calls to entity_form_field_validate()
- comment_form_validate in modules/
comment/ comment.module - Validate comment form submissions.
- field_test_entity_form_validate in modules/
field/ tests/ field_test.entity.inc - Validate handler for field_test_entity_form().
- node_form_validate in modules/
node/ node.pages.inc - Form validation handler for node_form().
- taxonomy_form_term_validate in modules/
taxonomy/ taxonomy.admin.inc - Validation handler for the term form.
- user_profile_form_validate in modules/
user/ user.pages.inc - Form validation handler for user_profile_form().
File
-
includes/
common.inc, line 8426
Code
function entity_form_field_validate($entity_type, $form, &$form_state) {
// All field attach API functions act on an entity object, but during form
// validation, we don't have one. $form_state contains the entity as it was
// prior to processing the current form submission, and we must not update it
// until we have fully validated the submitted input. Therefore, for
// validation, act on a pseudo entity created out of the form values.
$pseudo_entity = (object) $form_state['values'];
field_attach_form_validate($entity_type, $pseudo_entity, $form, $form_state);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.