function node_form_submit_build_node
Updates the form state's node entity by processing this submission's values.
This is the default builder function for the node form. It is called during the "Save" and "Preview" submit handlers to retrieve the entity to save or preview. This function can also be called by a "Next" button of a wizard to update the form state's entity with the current step's values before proceeding to the next step.
See also
2 calls to node_form_submit_build_node()
- node_form_build_preview in modules/
node/ node.pages.inc - Form submission handler for node_form().
- node_form_submit in modules/
node/ node.pages.inc - Form submission handler for node_form().
File
-
modules/
node/ node.pages.inc, line 498
Code
function node_form_submit_build_node($form, &$form_state) {
// @todo Legacy support for modules that extend the node form with form-level
// submit handlers that adjust $form_state['values'] prior to those values
// being used to update the entity. Module authors are encouraged to instead
// adjust the node directly within a hook_node_submit() implementation. For
// Drupal 8, evaluate whether the pattern of triggering form-level submit
// handlers during button-level submit processing is worth supporting
// properly, and if so, add a Form API function for doing so.
unset($form_state['submit_handlers']);
form_execute_handlers('submit', $form, $form_state);
$node = $form_state['node'];
entity_form_submit_build_entity('node', $node, $form, $form_state);
node_submit($node);
foreach (module_implements('node_submit') as $module) {
$function = $module . '_node_submit';
$function($node, $form, $form_state);
}
return $node;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.