diff --git a/core/lib/Drupal/Core/Field/FieldConfigBase.php b/core/lib/Drupal/Core/Field/FieldConfigBase.php index bcac2379202f0fdce457727011ef06a8c62ee205..fc18ccc40a0bfa537f855ba92d8f9679ab600667 100644 --- a/core/lib/Drupal/Core/Field/FieldConfigBase.php +++ b/core/lib/Drupal/Core/Field/FieldConfigBase.php @@ -281,6 +281,21 @@ public function postCreate(EntityStorageInterface $storage) { } } + /** + * {@inheritdoc} + */ + public static function postDelete(EntityStorageInterface $storage, array $fields) { + // Clear the cache upfront, to refresh the results of getBundles(). + \Drupal::service('entity_field.manager')->clearCachedFieldDefinitions(); + + // Notify the entity storage. + foreach ($fields as $field) { + if (!$field->deleted) { + \Drupal::service('field_definition.listener')->onFieldDefinitionDelete($field); + } + } + } + /** * {@inheritdoc} */ diff --git a/core/modules/field/src/Entity/FieldConfig.php b/core/modules/field/src/Entity/FieldConfig.php index 66d88deb2d3b7ba753a6c7007ec022160b7b8ee4..709c6eccd6f1032c321516e98fad53c8af9092e6 100644 --- a/core/modules/field/src/Entity/FieldConfig.php +++ b/core/modules/field/src/Entity/FieldConfig.php @@ -232,16 +232,7 @@ public static function preDelete(EntityStorageInterface $storage, array $fields) * {@inheritdoc} */ public static function postDelete(EntityStorageInterface $storage, array $fields) { - // Clear the cache upfront, to refresh the results of getBundles(). - \Drupal::service('entity_field.manager')->clearCachedFieldDefinitions(); - - // Notify the entity storage. - foreach ($fields as $field) { - if (!$field->deleted) { - \Drupal::service('field_definition.listener')->onFieldDefinitionDelete($field); - } - } - + parent::postDelete($storage, $fields); // If this is part of a configuration synchronization then the following // configuration updates are not necessary. $entity = reset($fields);