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
Loading
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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');
+11 −0
Original line number Diff line number Diff line
@@ -404,6 +404,17 @@ public function testSelectionHandlerSettings() {
    $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'));
  }

  /**