Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
/**
* 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
Comment | File | Size | Author |
---|---|---|---|
#1 | cck-n1351882-1.patch | 704 bytes | DamienMcKenna |
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.