Skip to content
Snippets Groups Projects
Verified Commit f0738dc9 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3421731 by larowlan, byrond: field_field_config_create should check if...

Issue #3421731 by larowlan, byrond: field_field_config_create should check if the config installer is syncing

(cherry picked from commit b32845ea)
parent 35adb459
No related branches found
No related tags found
7 merge requests!8376Drupal views: adding more granularity to the ‘use ajax’ functionality,!8300Issue #3443586 View area displays even when parent view has no results.,!7567Issue #3153723 by quietone, Hardik_Patel_12: Change the scaffolding...,!7565Issue #3153723 by quietone, Hardik_Patel_12: Change the scaffolding...,!7509Change label "Block description" to "Block type",!7344Issue #3292350 by O'Briat, KlemenDEV, hswong3i, smustgrave, quietone: Update...,!6922Issue #3412959 by quietone, smustgrave, longwave: Fix 12 'un' words
Pipeline #110268 canceled
...@@ -392,6 +392,9 @@ function field_field_storage_config_update(FieldStorageConfigInterface $field_st ...@@ -392,6 +392,9 @@ function field_field_storage_config_update(FieldStorageConfigInterface $field_st
* Determine the selection handler plugin ID for an entity reference field. * Determine the selection handler plugin ID for an entity reference field.
*/ */
function field_field_config_create(FieldConfigInterface $field) { function field_field_config_create(FieldConfigInterface $field) {
if ($field->isSyncing()) {
return;
}
// Act on all sub-types of the entity_reference field type. // Act on all sub-types of the entity_reference field type.
/** @var \Drupal\Core\Field\FieldTypePluginManager $field_type_manager */ /** @var \Drupal\Core\Field\FieldTypePluginManager $field_type_manager */
$field_type_manager = \Drupal::service('plugin.manager.field.field_type'); $field_type_manager = \Drupal::service('plugin.manager.field.field_type');
......
...@@ -404,6 +404,17 @@ public function testSelectionHandlerSettings() { ...@@ -404,6 +404,17 @@ public function testSelectionHandlerSettings() {
$field_storage->save(); $field_storage->save();
$field = FieldConfig::load($field->id()); $field = FieldConfig::load($field->id());
$this->assertEquals('views', $field->getSetting('handler')); $this->assertEquals('views', $field->getSetting('handler'));
// Check that selection handlers aren't changed during sync.
$field = FieldConfig::create([
'field_storage' => $field_storage,
'bundle' => 'entity_test',
'settings' => [
'handler' => 'fake:thing',
],
'isSyncing' => TRUE,
]);
$this->assertEquals('fake:thing', $field->getSetting('handler'));
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment