field_attach_submit

Versions
7
field_attach_submit($obj_type, $object, $form, &$form_state)

Perform necessary operations on field data submitted by a form.

Currently, this accounts for drag-and-drop reordering of field values, and filtering of empty values.

Parameters

$obj_type The type of $object; e.g. 'node' or 'user'.

$object The object being submitted. The 'bundle', 'id' and (if applicable) 'revision' keys should be present. The actual field values will be read from $form_state['values'].

$form The form structure to fill in.

$form_state An associative array containing the current state of the form.

Related topics

▾ 5 functions call field_attach_submit()

comment_form_submit_build_comment in modules/comment/comment.module
Build a comment by processing form values and prepare for a form rebuild.
field_test_entity_form_submit_builder in modules/field/tests/field_test.entity.inc
Builds a test_entity from submitted form values.
node_form_submit_build_node in modules/node/node.pages.inc
Build a node by processing submitted form values and prepare for a form rebuild.
taxonomy_form_term_submit_builder in modules/taxonomy/taxonomy.admin.inc
Build a term by processing form values and prepare for a form rebuild.
user_profile_form_submit in modules/user/user.pages.inc
Submit function for the user account and profile editing form.

Code

modules/field/field.attach.inc, line 771

<?php
function field_attach_submit($obj_type, $object, $form, &$form_state) {
  // Extract field values from submitted values.
  _field_invoke_default('extract_form_values', $obj_type, $object, $form, $form_state);

  _field_invoke_default('submit', $obj_type, $object, $form, $form_state);

  // Let other modules act on submitting the object.
  // Avoid module_invoke_all() to let $form_state be taken by reference.
  foreach (module_implements('field_attach_submit') as $module) {
    $function = $module . '_field_attach_submit';
    $function($obj_type, $object, $form, $form_state);
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.