1 node.pages.inc node_form_validate($form, &$form_state)

Form validation handler for node_form().

See also

node_form_submit()

node_form_submit_build_node()

File

core/modules/node/node.pages.inc, line 90
Callbacks for adding, editing, and deleting content and managing revisions.

Code

function node_form_validate($form, &$form_state) {
  // $form_state['node'] contains the actual entity being edited, but we must
  // not update it with form values that have not yet been validated, so we
  // create a pseudo-entity to use during validation.
  $node = clone $form_state['node'];
  foreach ($form_state['values'] as $key => $value) {
    $node->{$key} = $value;
  }
  node_validate($node, $form, $form_state);
  entity_form_field_validate('node', $form, $form_state);
}