diff --git a/core/modules/migrate_drupal/src/Plugin/MigrateCckFieldPluginManager.php b/core/modules/migrate_drupal/src/Plugin/MigrateCckFieldPluginManager.php index 5f635d9..63a5030 100644 --- a/core/modules/migrate_drupal/src/Plugin/MigrateCckFieldPluginManager.php +++ b/core/modules/migrate_drupal/src/Plugin/MigrateCckFieldPluginManager.php @@ -18,12 +18,21 @@ class MigrateCckFieldPluginManager extends MigratePluginManager { /** + * The default version of core to use for cck field plugins. + * + * These plugins were initially only built and used for Drupal 6 fields. + * Having been extended for Drupal 7 with a "core" annotation, we fall back to + * Drupal 6 where none exists. + */ + const DEFAULT_CORE_VERSION = 6; + + /** * {@inheritdoc} * * A specific createInstance method is necessary to pass the migration on. */ public function createInstance($field_type, array $configuration = array(), MigrationInterface $migration = NULL) { - $core = 6; + $core = static::DEFAULT_CORE_VERSION; if (!empty($configuration['core'])) { $core = $configuration['core']; } @@ -34,6 +43,7 @@ public function createInstance($field_type, array $configuration = array(), Migr } } } + foreach ($this->getDefinitions() as $plugin_id => $definition) { if (in_array($core, $definition['core'])) { if (array_key_exists($field_type, $definition['type_map']) || $field_type === $plugin_id) {