Commit 93c4b5fc authored by KarenS's avatar KarenS
Browse files

Issue #1039466 We need to switch the file module for file and image fields...

Issue #1039466 We need to switch the file module for file and image fields even if they use a custom widget or they will not show up as fields that can be migrated. Best we can do is display anything that has a 'imagefield' or 'filefield' prefix.
parent 56b496ff
......@@ -15,19 +15,20 @@
*/
function content_migrate_filefield_field_alter(&$field_value, $instance_value) {
switch ($instance_value['widget']['module']) {
case 'imagefield':
// Module names and types changed.
$field_value['module'] = 'image';
$field_value['type'] = 'image';
// default_image is now a field setting.
$field_value['settings']['default_image'] = $instance_value['widget']['settings']['default_image'];
break;
case 'filefield':
// Module names and types changed.
$field_value['module'] = 'file';
$field_value['type'] = 'file';
break;
// There are a bunch of custom imagefield widgets. If they at least start the widget name with 'imagefield' this will work.
if (substr($instance_value['widget']['type'], 0, 10) == 'imagefield') {
// Module names and types changed.
$field_value['module'] = 'image';
$field_value['type'] = 'image';
// default_image is now a field setting.
$field_value['settings']['default_image'] = $instance_value['widget']['settings']['default_image'];
}
// There are a bunch of custom filefield widgets. If they at least start the widget name with 'filefield' this will work.
if (substr($instance_value['widget']['type'], 0, 9) == 'filefield') {
// Module names and types changed.
$field_value['module'] = 'file';
$field_value['type'] = 'file';
break;
}
}
......
Markdown is supported
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