Yaffs site version 1.1
[yaffs-website] / web / modules / contrib / migrate_plus / migrate_plus.module
index ce7f5bee5ee1c800b89be7066eeea5e8c1597014..0dbddc473585b414b9e32191b7f2164e098f9022 100644 (file)
@@ -18,6 +18,24 @@ use Drupal\migrate_plus\Event\MigratePrepareRowEvent;
 function migrate_plus_migration_plugins_alter(array &$migrations) {
   /** @var \Drupal\migrate\Plugin\MigrationInterface $migration */
   foreach ($migrations as $id => $migration) {
+    // Add the default class where empty.
+    if (empty($migration['class'])) {
+      $migrations[$id]['class'] = 'Drupal\migrate\Plugin\Migration';
+    }
+
+    // For derived configuration entity-based migrations, strip the deriver
+    // prefix so we can reference migrations by the IDs they specify (i.e.,
+    // the migration that specifies "id: temp" can be referenced as "temp"
+    // rather than "migration_config_deriver:temp").
+    $prefix = 'migration_config_deriver:';
+    if (strpos($id, $prefix) === 0) {
+      $new_id = substr($id, strlen($prefix));
+      $migrations[$new_id] = $migrations[$id];
+      unset($migrations[$id]);
+      $id = $new_id;
+    }
+
+    // Integrate shared group configuration into the migration.
     if (empty($migration['migration_group'])) {
       $migration['migration_group'] = 'default';
     }