If you look through content_migrate.module you'll see things like this:

/**
 * Implements hook_content_migrate_data_record_alter().
 *
 * Tweaks individual records in a field.
 */
function content_migrate_content_migrate_data_record_alter(&$record, $field, $instance) {

  module_load_include('inc', 'content_migrate', 'modules/content_migrate.filefield');
  content_migrate_filefield_data_record_alter($record, $field, $instance);

}

and then in modules/content_migrate.filefield.inc it has e.g.:


/**
 * Implements hook_content_migrate_data_record_alter().
 *
 * Tweaks individual records in a field.
 */
function content_migrate_filefield_data_record_alter(&$record, $field, $instance) {
....
}

The problem with this is that it hardcodes which functions are executed for which hooks, rather than the hooks system deciding what needs to be executed.

This means that right now text_content_migrate_data_record_alter() is never actually executed so #1913072: Single on/off checkbox labels lost when upgrading to D7 with content_migrate can't be fixed without fixing the module's architecture itself.

It shouldn't be very hard to fix this, but the module should never have been written this way in the first place.

Comments

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new14.99 KB

This makes somewhat substantial changes to how the individual field-module files are loaded: instead of having core implementations of the various Content Migrate hooks that work as wrappers around the per-module integration, the per-module files are loaded at the top of content_migrate.admin.inc and then each per-module function is renamed to be an actual hook implementation on behalf of that module.

damienmckenna’s picture

Title: content_migrate's field handling is hardcoded » content_migrate's field-module handling is hardcoded
StatusFileSize
new13.16 KB

I'd accidentally included some code from #1913072: Single on/off checkbox labels lost when upgrading to D7 with content_migrate, this patch is just the changes necessary for the OP.

damienmckenna’s picture

FYI I've finally gotten these two patches to work on my local test bed without any problems, hopefully someone out there will be able to test them and give them the RTBC of approval so that 2.5 years after launch we can have a slightly more reliable upgrade for CCK.

Anonymous’s picture

Hum... this patch is not working with me:

News ° field_news_bilder ° filefield ° Missing field module: 'filefield'. This field cannot be migrated.

So... filefield disapeared?

colan’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
Issue summary: View changes
Status: Needs review » Fixed

Makes sense to me. Committed to dev branch in 52a40bc. I'll test this soon, when I release the next alpha.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.