diff --git a/migrate.inc b/migrate.inc index 9b72c81..ebffdd9 100644 --- a/migrate.inc +++ b/migrate.inc @@ -15,7 +15,13 @@ class MigrateRedirectEntityHandler extends MigrateDestinationHandler { } public function complete($entity, stdClass $row) { - if (($destination = entity_uri('node', $entity)) && !empty($entity->migrate_redirects)) { + + //Looking up the destination entity type for the current Migration + $migration = Migration::currentMigration(); + $destination = $migration->getDestination(); + $entity_type = $destination->getEntityType(); + + if (($destination = entity_uri($entity_type, $entity)) && !empty($entity->migrate_redirects)) { if (!is_array($entity->migrate_redirects)) { $entity->migrate_redirects = array($entity->migrate_redirects); }