diff --git a/core/modules/migrate_drupal/src/Plugin/MigrateCckFieldInterface.php b/core/modules/migrate_drupal/src/Plugin/MigrateCckFieldInterface.php index baa8ca6..b5a842f 100644 --- a/core/modules/migrate_drupal/src/Plugin/MigrateCckFieldInterface.php +++ b/core/modules/migrate_drupal/src/Plugin/MigrateCckFieldInterface.php @@ -58,6 +58,14 @@ public function processFieldFormatter(MigrationInterface $migration); public function getFieldFormatterMap(); /** + * Get a map between D6 and D8 widgets for this field type. + * + * @return array + * The keys are D6 field widget types and the values D8 widgets. + */ + public function getFieldWidgetMap(); + + /** * Apply any custom processing to the cck bundle migrations. * * @param \Drupal\migrate\Entity\MigrationInterface $migration diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/cckfield/CckFieldPluginBase.php b/core/modules/migrate_drupal/src/Plugin/migrate/cckfield/CckFieldPluginBase.php index 5cbaee5..301c6bd 100644 --- a/core/modules/migrate_drupal/src/Plugin/migrate/cckfield/CckFieldPluginBase.php +++ b/core/modules/migrate_drupal/src/Plugin/migrate/cckfield/CckFieldPluginBase.php @@ -42,13 +42,26 @@ public function processFieldInstance(MigrationInterface $migration) { * {@inheritdoc} */ public function processFieldWidget(MigrationInterface $migration) { - $process['type']['map'][$this->pluginId] = $this->pluginId . '_default'; + $process = []; + foreach ($this->getFieldWidgetMap() as $source_widget => $destination_widget) { + $process['type']['map'][$source_widget] = $destination_widget; + } $migration->mergeProcessOfProperty('options/type', $process); } /** * {@inheritdoc} */ + public function getFieldWidgetMap() { + // By default use the plugin id for the widget types. + return [ + $this->pluginId => $this->pluginId . '_default', + ]; + } + + /** + * {@inheritdoc} + */ public function processFieldFormatter(MigrationInterface $migration) { $process = []; foreach ($this->getFieldFormatterMap() as $source_format => $destination_format) {