You are here

function title_field_sync_set in Title 7

Synchronize a single regular field from its legacy field value.

Parameters

$entity_type: The name of the entity type.

$entity: The entity to work with.

$legacy_field: The name of the legacy field to be replaced.

$info: Field replacement information for the given entity.

$langcode: The field language to use for the target value.

File

./title.module, line 530

Code

function title_field_sync_set($entity_type, $entity, $legacy_field, $info, $langcode) {
  if (property_exists($entity, $legacy_field)) {

    // Find out the actual language to use (field might be untranslatable).
    $field = field_info_field($info['field']['field_name']);
    $langcode = field_is_translatable($entity_type, $field) ? $langcode : LANGUAGE_NONE;
    $info['callbacks']['sync_set']($entity_type, $entity, $legacy_field, $info, $langcode);
  }
}