diff core/modules/migrate_drupal/src/Plugin/MigrateFieldPluginManager.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children af1871eacc83
line wrap: on
line diff
--- a/core/modules/migrate_drupal/src/Plugin/MigrateFieldPluginManager.php	Mon Apr 23 09:33:26 2018 +0100
+++ b/core/modules/migrate_drupal/src/Plugin/MigrateFieldPluginManager.php	Mon Apr 23 09:46:53 2018 +0100
@@ -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 @@
     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);
+      }
+    }
+  }
+
 }