Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / migrate / src / Plugin / migrate / destination / Config.php
index b8db601d14989bdb652b0ed61a6d4889e6afe491..18d78a325e1cde669db74ebbb45c0822d695227e 100644 (file)
@@ -195,4 +195,26 @@ class Config extends DestinationBase implements ContainerFactoryPluginInterface,
     }
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function getDestinationModule() {
+    if (!empty($this->configuration['destination_module'])) {
+      return $this->configuration['destination_module'];
+    }
+    if (!empty($this->pluginDefinition['destination_module'])) {
+      return $this->pluginDefinition['destination_module'];
+    }
+    // Config translations require the config_translation module so set the
+    // migration provider to 'config_translation'. The corresponding non
+    // translated configuration is expected to be handled in a separate
+    // migration.
+    if (isset($this->configuration['translations'])) {
+      return 'config_translation';
+    }
+    // Get the module handling this configuration object from the config_name,
+    // which is of the form <module_name>.<configuration object name>
+    return !empty($this->configuration['config_name']) ? explode('.', $this->configuration['config_name'], 2)[0] : NULL;
+  }
+
 }