diff --git a/core/modules/migrate_drupal/src/Plugin/MigrateFieldPluginManager.php b/core/modules/migrate_drupal/src/Plugin/MigrateFieldPluginManager.php index 7eb8575..95cdc69 100644 --- a/core/modules/migrate_drupal/src/Plugin/MigrateFieldPluginManager.php +++ b/core/modules/migrate_drupal/src/Plugin/MigrateFieldPluginManager.php @@ -2,6 +2,7 @@ namespace Drupal\migrate_drupal\Plugin; +use Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException; use Drupal\Component\Plugin\Exception\PluginNotFoundException; use Drupal\migrate\Plugin\MigratePluginManager; use Drupal\migrate\Plugin\MigrationInterface; @@ -61,7 +62,7 @@ public function processDefinition(&$definition, $plugin_id) { foreach (['id', 'core', 'source_module', 'destination_module'] as $required_property) { if (empty($definition[$required_property])) { - @trigger_error(sprintf('The field plugin should define the %s property.', $plugin_id, $required_property)); + throw new InvalidPluginDefinitionException(sprintf('The field plugin should define the %s property.', $plugin_id, $required_property)); } } } diff --git a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php index df24ca6..061c2f1 100644 --- a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php +++ b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php @@ -501,16 +501,10 @@ public function buildConfirmForm(array $form, FormStateInterface $form_state) { foreach ($field_types as $field_type => $value) { try { $plugin_id = $this->fieldPluginManager->getPluginIdFromFieldType($field_type, ['core' => $version]); - $field_def = $this->fieldPluginManager->getDefinition($plugin_id); - $field_plugin_id = $field_def['id']; - $source_module = $field_def['source_module']; - if (!$source_module) { - drupal_set_message($this->t('Source module not found for field plugin @field_plugin_id.', ['@field_plugin_id' => $field_plugin_id]), 'error'); - } - $destination_module = $field_def['destination_module']; - if (!$destination_module) { - drupal_set_message($this->t('Destination module not found for field plugin @field_plugin_id.', ['@field_plugin_id' => $field_plugin_id]), 'error'); - } + $field_definition = $this->fieldPluginManager->getDefinition($plugin_id); + $field_plugin_id = $field_definition['id']; + $source_module = $field_definition['source_module']; + $destination_module = $field_definition['destination_module']; if (($destination_module == 'core') || $this->moduleHandler->moduleExists($destination_module)) { $table_data[$source_module][$destination_module][$field_plugin_id] = $field_plugin_id; }