function data_entity_entity_edit_form_validate in Data 7
Form validation handler for saving a data entity.
File
- data_entity/
data_entity.pages.inc, line 79 - Contains general page callbacks and associated functions.
Code
function data_entity_entity_edit_form_validate($form, &$form_state) {
$data_entity = $form['#entity'];
$entity_type = $data_entity->entity_type;
// Build a pseudo entity for FieldAPI field attach.
$pseudo_entity = $form_state['values'];
unset($pseudo_entity['data'], $pseudo_entity['table']);
$pseudo_entity += $form_state['values']['data'];
$pseudo_entity = (object) $pseudo_entity;
field_attach_form_validate($entity_type, $pseudo_entity, $form, $form_state);
}