Fix some remaining problems from trying to add instance data to the data alter field...
authorKaren Stevenson
Fri, 20 May 2011 21:07:59 +0000 (16:07 -0500)
committerKaren Stevenson
Fri, 20 May 2011 21:07:59 +0000 (16:07 -0500)
modules/content_migrate/content_migrate.api.php
modules/content_migrate/content_migrate.module
modules/content_migrate/includes/content_migrate.admin.inc

index 65a232a..e8146eb 100644 (file)
@@ -64,7 +64,7 @@ function hook_content_migrate_instance_alter(&$instance_value, $field_value) {
  * @param $field
  *
  */
-function hook_content_migrate_data_record_alter(&$record, $field) {
+function hook_content_migrate_data_record_alter(&$record, $field, $instance) {
   switch($field['type']) {
     case 'file':
       // Map D6 filefield field columns to D7 file field columns. Note the data
index b0e50a2..90e2ace 100644 (file)
@@ -205,10 +205,10 @@ function content_migrate_content_migrate_instance_alter(&$instance_value, $field
  *
  * Tweaks individual records in a field.
  */
-function content_migrate_content_migrate_data_record_alter(&$record, $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);
+  content_migrate_filefield_data_record_alter($record, $field, $instance);
 
 }
 
index f395964..adf1b3d 100644 (file)
@@ -328,8 +328,8 @@ function _content_migrate_batch_process_migrate_data($field_name, &$context) {
     return;
   }
 
-  $field = $context['sandbox']['fields'][$field_name];
-  $instance = $context['sandbox']['instances'][$field_name][$node['type']];
+  $field = field_info_field($field_name);
+  $instance = field_info_instance('node', $field_name, $node['type']);
 
   // Construct an record to insert into the new field table
   // from the data in the old table.