Commit 0fc7b5d4 authored by John C Fiala's avatar John C Fiala
Browse files

task #970392 by jcfiala: Added content_migrate_field_alter and...

task #970392 by jcfiala: Added content_migrate_field_alter and content_migrate_instance_alter hooks to link.module to help with upgrading from D6 to D7.
parent 42cf42ec
......@@ -822,3 +822,25 @@ function link_validate_url($text) {
return FALSE;
}
/**
* Implements hook_migrate_field_alter().
*/
function link_content_migrate_field_alter(&$field_value, $instance_value) {
if ($field_value['type'] == 'link') {
// need to change the type:
$field_value['type'] = 'link_field';
}
}
/**
* Implements hook_migrate_instance_alter().
*
* Widget type also changed to link_field.
*/
function link_content_migrate_instance_alter(&$instance_value, $field_value) {
if ($instance_value['widget']['module'] == 'link'
&& $instance_value['widget']['type'] == 'link') {
$instance_value['widget']['type'] = 'link_field';
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment