Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295818

Move cache clearing in FieldConfig::postDelete() to FieldConfigBase

$
0
0

Problem/Motivation

Config fields are split between two classes:

- FieldConfigBase, in the Field core component
- FieldConfig, which inherits from it, in the field module.

FieldConfigBase handles clearing caches on save, in postSave():

    // Clear the cache.
    \Drupal::service('entity_field.manager')->clearCachedFieldDefinitions();

However, for deleting a field, it's in FieldConfig::postDelete():

    // 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);
      }
    }

This part of the code in postDelete() should be moved up to the parent class for consistency.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes


Viewing all articles
Browse latest Browse all 295818


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>