Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / migrate_drupal / src / Plugin / MigrateFieldPluginManager.php
index 2b33c858b990c9fa698c600d5211d6b9049b268f..7a9c47907eb77fd66fa79337d45f3082a7bba4f2 100644 (file)
@@ -3,6 +3,7 @@
 namespace Drupal\migrate_drupal\Plugin;
 
 use Drupal\Component\Plugin\Exception\PluginNotFoundException;
+use Drupal\migrate\Plugin\Exception\BadPluginDefinitionException;
 use Drupal\migrate\Plugin\MigratePluginManager;
 use Drupal\migrate\Plugin\MigrationInterface;
 
@@ -53,4 +54,17 @@ class MigrateFieldPluginManager extends MigratePluginManager implements MigrateF
     throw new PluginNotFoundException($field_type);
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function processDefinition(&$definition, $plugin_id) {
+    parent::processDefinition($definition, $plugin_id);
+
+    foreach (['core', 'source_module', 'destination_module'] as $required_property) {
+      if (empty($definition[$required_property])) {
+        throw new BadPluginDefinitionException($plugin_id, $required_property);
+      }
+    }
+  }
+
 }