You are here

function title_field_attach_update in Title 7

Implements hook_field_attach_update().

File

./title.module, line 182

Code

function title_field_attach_update($entity_type, $entity) {

  // Reset the field_attach_presave static cache so that subsequent saves work
  // correctly.
  $sync =& drupal_static('title_field_attach_presave', array());
  list($id, , ) = entity_extract_ids($entity_type, $entity);
  unset($sync[$entity_type][$id]);

  // Immediately after saving the entity we need to ensure that the legacy field
  // holds a value corresponding to the current active language, as it were
  // just loaded.
  title_entity_sync($entity_type, $entity);
}