Commit 57a78f13 authored by KarenS's avatar KarenS
Browse files

#1039466 by yched, Don't clobber formatter settings provided by third party modules.

parent 70de9852
......@@ -60,9 +60,7 @@ function content_migrate_number_field_alter(&$field_value, $instance_value) {
* formatter or widget names or settings are changed.
*/
function content_migrate_number_instance_alter(&$instance_value, $field_value) {
// Switch
switch ($instance_value['widget']['module']) {
switch ($field_value['module']) {
case 'number':
// The number formatters and formatter settings
// have changed.
......@@ -142,9 +140,11 @@ function content_migrate_number_instance_alter(&$instance_value, $field_value) {
),
);
foreach ($instance_value['display'] as $context => $settings) {
if ($settings['module'] == 'number') {
$instance_value['display'][$context]['type'] = $new_type[$settings['type']];
$instance_value['display'][$context]['settings'] = $new_settings[$settings['type']];
}
}
break;
}
......
......@@ -76,15 +76,15 @@ function content_migrate_text_field_alter(&$field_value, $instance_value) {
* formatter or widget names or settings are changed.
*/
function content_migrate_text_instance_alter(&$instance_value, $field_value) {
// Switch
switch ($instance_value['widget']['module']) {
switch ($field_value['module']) {
case 'text':
// The formatter names changed, all are prefixed
// with 'text_'.
foreach ($instance_value['display'] as $context => $settings) {
if ($settings['module'] == 'text') {
$instance_value['display'][$context]['type'] = 'text_'. $settings['type'];
}
}
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