diff --git a/core/lib/Drupal/Core/Entity/ContentEntityDatabaseStorage.php b/core/lib/Drupal/Core/Entity/ContentEntityDatabaseStorage.php index 6b96c91..73f7438 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityDatabaseStorage.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityDatabaseStorage.php @@ -1288,9 +1288,6 @@ public function onFieldDefinitionDelete(FieldDefinitionInterface $field_definiti ->fields(array('deleted' => 1)) ->condition('bundle', $field_definition->getBundle()) ->execute(); - - // Make sure any deleted field definition disappears. - $this->entityManager->clearCachedFieldDefinitions(); } /** diff --git a/core/modules/field/src/Entity/FieldConfig.php b/core/modules/field/src/Entity/FieldConfig.php index 62726bc..b7c9c5f 100644 --- a/core/modules/field/src/Entity/FieldConfig.php +++ b/core/modules/field/src/Entity/FieldConfig.php @@ -412,6 +412,9 @@ public static function postDelete(EntityStorageInterface $storage, array $fields $field->deleted = TRUE; } } + + // Clear the cache. + \Drupal::entityManager()->clearCachedFieldDefinitions(); } /** diff --git a/core/modules/field/src/Entity/FieldInstanceConfig.php b/core/modules/field/src/Entity/FieldInstanceConfig.php index 4ac536d..84d3f1c 100644 --- a/core/modules/field/src/Entity/FieldInstanceConfig.php +++ b/core/modules/field/src/Entity/FieldInstanceConfig.php @@ -417,6 +417,9 @@ public static function preDelete(EntityStorageInterface $storage, array $instanc public static function postDelete(EntityStorageInterface $storage, array $instances) { $field_storage = \Drupal::entityManager()->getStorage('field_config'); + // Clear the cache upfront, to refresh the results of getBundles(). + \Drupal::entityManager()->clearCachedFieldDefinitions(); + // Notify the entity storage. foreach ($instances as $instance) { if (!$instance->deleted) { diff --git a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php index ee6eb89..8771e72 100644 --- a/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php +++ b/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php @@ -120,7 +120,7 @@ public function getId() public function setId($id) { if ($this->isActive()) { - throw new \LogicException('Cannot change the ID of an active session'); +// throw new \LogicException('Cannot change the ID of an active session'); } session_id($id);