0

I'm trying to import content on installation of my feature, but it's not happening. If I enable the migrate_ui module and go and manually execute the import, then it imports fine.

The code below is from my module.install file, which was originally taken from the restaurant_event feature of the Restaurant Distribution.

/**
 * Implements hook_enable().
 */
function parcel_event_demo_enable() {
  Migration::registerMigration('ParcelEventMigrateEvent');
}

/**
 * Implements hook_disable().
 */
function parcel_event_demo_disable() {
  Migration::deregisterMigration('ParcelEventMigrateEvent');
}

1 Answer 1

0

Ok, I now understand that registering a migration is only registering it, not importing it, you still have to process the import. I now call the _panopoly_core_import_demo_content function which executes $migration->processImport();

<?php

/**
 * @file
 * Installation file for Parcel Event Demo
 */

/**
 * Implements hook_enable().
 */
function parcel_event_demo_enable() {
  Migration::registerMigration('ParcelEventMigrateEvent');
  _panopoly_core_import_demo_content(array('ParcelEventMigrateEvent'));
}

/**
 * Implements hook_disable().
 */
function parcel_event_demo_disable() {
  _panopoly_core_rollback_demo_content(array('ParcelEventMigrateEvent'));
  Migration::deregisterMigration('ParcelEventMigrateEvent');
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.