You are here

function phone_field_alter in Phone 7

Implements hook_content_migrate_field_alter().

Use this to tweak the conversion of field settings from the D6 style to the D7 style for specific situations not handled by basic conversion, as when field types or settings are changed.

1 call to phone_field_alter()
phone_content_migrate_field_alter in ./phone.module
Implements hook_content_migrate_field_alter().

File

./phone.migrate.inc, line 16
phone.migrate.inc Code to implement hook_content_migrate_field_alter, content_migrate_instance_alter() and content_migrate_data_record_alter() on behalf of the former phone module, moved into a separate file for efficiency.

Code

function phone_field_alter(&$field_value, $instance_value) {
  if (substr($field_value['type'], 2) === '_phone') {
    $code = substr($field_value['type'], 0, 2);
    $field_value['type'] = 'phone';
    $field_value['settings']['country'] = $code;
  }
}