function hook_entity_insert


Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/
cis7 system.api.php hook_entity_insert($entity, $type)
cle7 system.api.php hook_entity_insert($entity, $type)
elmsmedia7 system.api.php hook_entity_insert($entity, $type)
icor7 system.api.php hook_entity_insert($entity, $type)
meedjum_blog7 system.api.php hook_entity_insert($entity, $type)
mooc7 system.api.php hook_entity_insert($entity, $type)

Act on entities when inserted.


$entity: The entity object.

$type: The type of entity being inserted (i.e. node, user, comment).

Related topics

10 functions implement hook_entity_insert()

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

entitycache_entity_insert in sites/all/modules/ulmus/entitycache/entitycache.module
Implements hook_entity_insert().
entityreference_entity_insert in sites/all/modules/ulmus/entityreference/entityreference.module
Implements hook_entity_insert().
entity_crud_hook_test_entity_insert in modules/simpletest/tests/entity_crud_hook_test.module
Implements hook_entity_insert().
entity_test_entity_insert in sites/all/modules/ulmus/entity/tests/entity_test.module
Implements hook_entity_insert().
entity_watchdog_entity_insert in sites/all/modules/elmsln_contrib/entity_watchdog/entity_watchdog.module
Implements hook_entity_insert($entity, $type).

... See full list

7 invocations of hook_entity_insert()
comment_save in modules/comment/comment.module
Accepts a submission of new or changed comment content.
EntityAPIController::save in sites/all/modules/ulmus/entity/includes/
Implements EntityAPIControllerInterface.
field_attach_insert in modules/field/
Save field data for a new entity.
file_save in includes/
Saves a file object to the database.
taxonomy_vocabulary_save in modules/taxonomy/taxonomy.module
Saves a vocabulary.

... See full list


modules/system/system.api.php, line 328
Hooks provided by Drupal core and the System module.


function hook_entity_insert($entity, $type) {
  // Insert the new entity into a fictional table of all entities.
  $info = entity_get_info($type);
  list($id) = entity_extract_ids($type, $entity);
    'type' => $type,
    'id' => $id,
    'created' => REQUEST_TIME,
    'updated' => REQUEST_TIME,



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.