Commit 1b82d068 authored by KarenS's avatar KarenS
Browse files

Issue #1117028 Add messages to the textfield changes. Make an assumption that...

Issue #1117028 Add messages to the textfield changes. Make an assumption that a text with no maxlength that uses a textfield widget was intended to be a varchar field with a textfield widget. Users can see from the message what will happen so they will not migrate the field if that is not desired.
parent cc335bda
......@@ -18,6 +18,7 @@ function content_migrate_filefield_field_alter(&$field_value, $instance_value) {
// 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['messages'][] = t("Changed field type: The '@field' field type will be changed from '@type' to 'image'.", array('@type' => $field_value['type'], '@field' => $field_value['field_name'], '@widget' => $instance_value['widget']['type']));
$field_value['module'] = 'image';
$field_value['type'] = 'image';
// default_image is now a field setting.
......@@ -26,6 +27,7 @@ function content_migrate_filefield_field_alter(&$field_value, $instance_value) {
// 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['messages'][] = t("Changed field type: The '@field' field type will be changed from '@type' to 'file'.", array('@type' => $field_value['type'], '@field' => $field_value['field_name'], '@widget' => $instance_value['widget']['type']));
$field_value['module'] = 'file';
$field_value['type'] = 'file';
}
......
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