Issue #3421731 by larowlan, byrond: field_field_config_create should check if the config installer is syncing
(cherry picked from commit b32845ead7
)
merge-requests/6840/head
parent
35adb459bc
commit
f0738dc9ee
|
@ -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 @@ class EntityReferenceItemTest extends FieldKernelTestBase {
|
||||||
$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'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue