I'm trying use two group of migration named prepare and hn. I want make migration of hn group dependant from prepare group. I try this code without success:

/**
 * Implements hook_migrate_api().
 */
function hn_migrate_migrate_api() {
  $api = array(
    'api' => 2,
    'groups' => array(
      'prepare' => array(
        'title' => 'HNonline prepare migration',
      ),
      'hn' => array(
        'title' => 'HNonline',
        'dependencies' => array('prepare'),
      ),
    ),
    'migrations' => array(
      'PrepareAttachment' => array(
        'class_name' => 'PrepareAttachmentMigration',
        'group_name' => 'prepare',
      ),
      'PrepareImage' => array(
        'class_name' => 'PrepareImageMigration',
        'group_name' => 'prepare',
      ),
      'Attachments' => array(
        'class_name' => 'AttachmentsMigration',
        'group_name' => 'hn',
      ),
      'Articles' => array(
        'class_name' => 'ArticlesMigration',
        'group_name' => 'hn',
      ),
    ),
  );
  return $api;
}

How can i do this? Thanks!

Comments

mikeryan’s picture

Assigned: Unassigned » mikeryan
Category: support » bug

That's a bug, I'll take care of it.

Thanks.

mikeryan’s picture

Status: Active » Fixed

Committed, thanks.

havran’s picture

Thanks for quick fix. In command line seems all ok but in Migrate UI i get notice:

Notice: Undefined index: dependencies v MigrateGroup::getInstance() (riadok 137 z /var/www/vhosts/hnonline/public_html/sites/all/modules/contrib/migrate/includes/group.inc).
mikeryan’s picture

mikeryan’s picture

I've committed the patch in #1989088: Notice: Undefined index: dependencies in MigrateGroup::getInstance(). Note this is one of those cases where an issue is best reopened, when a problem is quickly found in a recent commit (this is why Drupal issues remain in the "fixed" state, visible in the default "Open issues" view, for two weeks before being closed) - I left things as they were because there was a patch in the duplicate issue.

Thanks.

Status: Fixed » Closed (fixed)

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