/**
* Implements hook_content_migrate_data_record_alter().
*
* Tweaks individual records in a field.
*/
function content_migrate_text_data_record_alter(&$record, $field, $instance) {
$existing_formats = &drupal_static(__FUNCTION__);
if (empty($existing_formats)) {
$existing_formats = db_query("SELECT format FROM {filter_format}")->fetchCol();
}
switch($field_value['module']) {
case 'text':
if (!empty($instance['settings']['text_processing'])) {
// Adapted from node_update_7006(), to adjust the filter format values
// from the old numeric to the new text formats. Ensure we have a valid value.
if (!in_array($record[$field['field_name'] . '_format'], $existing_formats)) {
$record[$field['field_name'] . '_format'] = variable_get('filter_default_format', 1);
}
}
}
}
switch($field_value['module']) {
will never be entered because there is NO avaliable value $field_value
Comments
Comment #1
damienmckennaJust saw this while debugging #1913072: Single on/off checkbox labels lost when upgrading to D7 with content_migrate. Might this work?
Comment #2
damienmckennaComment #3
colanLooks like this was fixed over there.