function hook_field_storage_pre_insert

Act before the storage backends insert field data.

This hook allows modules to store data before the Field Storage API, optionally preventing the field storage module from doing so.


$entity_type: The type of $entity; for example, 'node' or 'user'.

$entity: The entity with fields to save.

$skip_fields: An array keyed by field IDs whose data has already been written and therefore should not be written again. The values associated with these keys are not specified.

Return value

Saved field IDs are set set as keys in $skip_fields.

Related topics

1 function implements hook_field_storage_pre_insert()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

forum_field_storage_pre_insert in drupal/modules/forum/forum.module
Implements hook_field_storage_pre_insert().
1 invocation of hook_field_storage_pre_insert()
field_attach_insert in drupal/modules/field/
Save field data for a new entity.


drupal/modules/field/field.api.php, line 2231
Hooks provided by the Field module.


function hook_field_storage_pre_insert($entity_type, $entity, &$skip_fields) {
  if ($entity_type == 'node' && $entity->status && _forum_node_check_node_type($entity)) {
    $query = db_insert('forum_index')
    foreach ($entity->taxonomy_forums as $language) {
      foreach ($language as $delta) {
          'nid' => $entity->nid,
          'title' => $entity->title,
          'tid' => $delta['value'],
          'sticky' => $entity->sticky,
          'created' => $entity->created,
          'comment_count' => 0,
          'last_comment_timestamp' => $entity->created,