You are here

function text_content_migrate_instance_alter in Content Construction Kit (CCK) 7.3

Implements hook_content_migrate_instance_alter().

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

File

modules/content_migrate/modules/content_migrate.text.inc, line 108
content_migrate.text.inc Code to implement Content Migrate hooks on behalf of the Text module.

Code

function text_content_migrate_instance_alter(&$instance_value, $field_value) {
  switch ($field_value['module']) {
    case 'text':

      // The text processing setting got switched from a field setting to an instance setting.
      $instance_value['settings']['text_processing'] = $field_value['settings']['text_processing'];

      // The formatter names changed, all are prefixed
      // with 'text_'.
      foreach ($instance_value['display'] as $context => $settings) {
        $instance_value['display'][$context]['type'] = 'text_' . $settings['type'];
      }
      break;
  }
}