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
Alex Pott 2024-03-04 10:12:58 +00:00
parent 35adb459bc
commit f0738dc9ee
No known key found for this signature in database
GPG Key ID: BDA67E7EE836E5CE
2 changed files with 14 additions and 0 deletions

View File

@ -392,6 +392,9 @@ function field_field_storage_config_update(FieldStorageConfigInterface $field_st
* Determine the selection handler plugin ID for an entity reference field.
*/
function field_field_config_create(FieldConfigInterface $field) {
if ($field->isSyncing()) {
return;
}
// Act on all sub-types of the entity_reference field type.
/** @var \Drupal\Core\Field\FieldTypePluginManager $field_type_manager */
$field_type_manager = \Drupal::service('plugin.manager.field.field_type');

View File

@ -404,6 +404,17 @@ class EntityReferenceItemTest extends FieldKernelTestBase {
$field_storage->save();
$field = FieldConfig::load($field->id());
$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'));
}
/**