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.
SO im migrating content from d6 to d7 but i cannot seem to get images to work.
$this->addFieldMapping('field_checklist_badge_active', 'field_checklist_badge_active')
->sourceMigration('filemigration');
$this->addFieldMapping('field_checklist_badge_active:file_class')
->defaultValue('MigrateFileFid');
- field_checklist_badge_active is a fid in the $row array.
class FileMigration extends DrupalFile6Migration {
public function __construct(array $arguments) {
parent::__construct($arguments);
}
}
and for the migrate hook:
$api['migrations']['filemigration'] = $common_arguments + array(
'machine_name' => 'filemigration',
'description' => t('Import Drupal 6 files'),
'class_name' => 'FileMigration', // custom class that extends the DrupalFile6Migration and nothing more
'default_uid' => 1,
'source_dir' => 'http://test.be',
'destination_dir' => 'public://',
);
If I run the files migration from the ui or drush they do get imported, but it seems the "sourceMigration" is not working.
Am i missing something? I also do not get any logging of what might have happened wrong.
Regards,
Mo
Comments
Comment #2
mojo4444 CreditAttribution: mojo4444 commentedBump