diff --git a/core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManager.php b/core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManager.php index 9918a58..199a8cf 100644 --- a/core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManager.php +++ b/core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManager.php @@ -49,7 +49,16 @@ public function getInstance(array $options) { 'handler_settings' => array(), ); - return $this->createInstance($options['handler'], $options); + // A specific selection plugin ID was already specified. + if (strpos($options['handler'], ':') !== FALSE) { + $plugin_id = $options['handler']; + } + // Only a selection group name was specified. + else { + $plugin_id = $this->getPluginId($options['target_type'], $options['handler']); + } + + return $this->createInstance($plugin_id, $options); } /** diff --git a/core/modules/entity_reference/entity_reference.module b/core/modules/entity_reference/entity_reference.module index 6e63c08..8560762 100644 --- a/core/modules/entity_reference/entity_reference.module +++ b/core/modules/entity_reference/entity_reference.module @@ -87,8 +87,6 @@ function entity_reference_field_storage_config_update(FieldStorageConfigInterfac foreach ($field_storage->getBundles() as $bundle) { $field = FieldConfig::loadByName($field_storage->getTargetEntityTypeId(), $bundle, $field_storage->getName()); - list($current_handler) = explode(':', $field->settings['handler'], 2); - $field->settings['handler'] = \Drupal::service('plugin.manager.entity_reference_selection')->getPluginId($field_storage->getSetting('target_type'), $current_handler); $field->settings['handler_settings'] = array(); $field->save(); } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php index daac5b2..2165619 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php @@ -134,7 +134,9 @@ public function testFieldInstanceSettings() { 'display_field' => FALSE, 'display_default' => FALSE, 'uri_scheme' => 'public', - 'handler' => 'default', + // This value should be 'default:file' but the test does not migrate field + // storages so we end up with the default value for this setting. + 'handler' => 'default:node', 'handler_settings' => array(), 'target_bundle' => NULL, ); diff --git a/core/modules/taxonomy/src/Plugin/Field/FieldType/TaxonomyTermReferenceItem.php b/core/modules/taxonomy/src/Plugin/Field/FieldType/TaxonomyTermReferenceItem.php index 898c9de..c2ed1f0 100644 --- a/core/modules/taxonomy/src/Plugin/Field/FieldType/TaxonomyTermReferenceItem.php +++ b/core/modules/taxonomy/src/Plugin/Field/FieldType/TaxonomyTermReferenceItem.php @@ -50,6 +50,15 @@ public static function defaultStorageSettings() { /** * {@inheritdoc} */ + public static function defaultFieldSettings() { + return array( + 'handler' => 'default:taxonomy_term', + ) + parent::defaultFieldSettings(); + } + + /** + * {@inheritdoc} + */ public function getPossibleValues(AccountInterface $account = NULL) { // Flatten options firstly, because Possible Options may contain group // arrays.