Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / migrate / src / Plugin / Migration.php
index cc8d804da5e534c9211955a5b11df104730607eb..20b8ae877b9033cd8f6d314b20d467b9dc05b959 100644 (file)
@@ -216,7 +216,7 @@ class Migration extends PluginBase implements MigrationInterface, RequirementsIn
   protected $sourcePluginManager;
 
   /**
-   * Thep process plugin manager.
+   * The process plugin manager.
    *
    * @var \Drupal\migrate\Plugin\MigratePluginManager
    */
@@ -410,7 +410,7 @@ class Migration extends PluginBase implements MigrationInterface, RequirementsIn
    */
   public function getDestinationPlugin($stub_being_requested = FALSE) {
     if ($stub_being_requested && !empty($this->destination['no_stub'])) {
-      throw new MigrateSkipRowException();
+      throw new MigrateSkipRowException('Stub requested but not made because no_stub configuration is set.');
     }
     if (!isset($this->destinationPlugin)) {
       $this->destinationPlugin = $this->destinationPluginManager->createInstance($this->destination['plugin'], $this->destination, $this);
@@ -554,7 +554,6 @@ class Migration extends PluginBase implements MigrationInterface, RequirementsIn
     return $this;
   }
 
-
   /**
    * {@inheritdoc}
    */
@@ -620,19 +619,22 @@ class Migration extends PluginBase implements MigrationInterface, RequirementsIn
   }
 
   /**
-   * Find migration dependencies from the migration and the iterator plugins.
+   * Find migration dependencies from migration_lookup and sub_process plugins.
+   *
+   * @param array $process
+   *   A process configuration array.
    *
-   * @param $process
    * @return array
+   *   The migration dependencies.
    */
   protected function findMigrationDependencies($process) {
     $return = [];
     foreach ($this->getProcessNormalized($process) as $process_pipeline) {
       foreach ($process_pipeline as $plugin_configuration) {
-        if ($plugin_configuration['plugin'] == 'migration') {
+        if (in_array($plugin_configuration['plugin'], ['migration', 'migration_lookup'], TRUE)) {
           $return = array_merge($return, (array) $plugin_configuration['migration']);
         }
-        if ($plugin_configuration['plugin'] == 'sub_process') {
+        if (in_array($plugin_configuration['plugin'], ['iterator', 'sub_process'], TRUE)) {
           $return = array_merge($return, $this->findMigrationDependencies($plugin_configuration['process']));
         }
       }