You are here

function postal_code_content_migrate_instance_alter in Postal Code 7

Implements this hook to alter the instance definition of the migrated content.

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.

Parameters

$instance_value:

$field_value:

File

./content_migrate.zipcode.inc, line 59
Zipcode content_migrate file

Code

function postal_code_content_migrate_instance_alter(&$instance_value, $field_value) {
  switch ($instance_value['widget']['module']) {
    case 'zipcode':
      $country = str_replace('_zipcode', '', $field_value['type']);
      if (_postal_code_content_migrate_is_supported_country($country)) {
        $widget_type = 'postal_code_' . $country . '_postal_code_form';
        $instance_value['widget_type'] = $widget_type;
        $instance_value['widget']['type'] = $widget_type;
        $instance_value['widget']['module'] = 'postal_code';
      }
      break;
  }
}