You are here

function email_content_migrate_instance_alter in Email Field 7

Implements hook_content_migrate_instance_alter().

D6-D7 upgrade fixes new formatter names

File

./email.module, line 518
Module file for the email module, which creates a email address field.

Code

function email_content_migrate_instance_alter(&$instance_value, &$field_value) {
  if ($field_value['module'] == 'email') {
    foreach ($instance_value['display'] as $context => $settings) {
      if (in_array($instance_value['display'][$context]['type'], array(
        'default',
        'plain',
        'contact',
        'spamspan',
      ))) {
        $instance_value['display'][$context]['type'] = 'email_' . $instance_value['display'][$context]['type'];
      }
    }
  }
}