diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php b/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php index b7f2dfc..7f8c203 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php @@ -354,6 +354,8 @@ public function save(EntityInterface $entity) { // - The object needs to be renamed/copied in ConfigFactory and reloaded. // - All instances of the object need to be renamed. $config = $this->configFactory->rename($prefix . $id, $prefix . $entity->id()); + // Reset the cache for the old entity. + $this->resetCache(array($id)); } // Build an ID if none is set. diff --git a/core/modules/entity/lib/Drupal/entity/Tests/EntityDisplayTest.php b/core/modules/entity/lib/Drupal/entity/Tests/EntityDisplayTest.php index dd6b409..dc0ac31 100644 --- a/core/modules/entity/lib/Drupal/entity/Tests/EntityDisplayTest.php +++ b/core/modules/entity/lib/Drupal/entity/Tests/EntityDisplayTest.php @@ -274,10 +274,8 @@ public function testRenameDeleteBundle() { $type->old_type = 'article'; $type->type = 'article_rename'; $type->save(); - \Drupal::entityManager()->getStorageController('entity_view_display')->resetCache(); $old_display = entity_load('entity_view_display', 'node.article.default'); $this->assertFalse($old_display); - \Drupal::entityManager()->getStorageController('entity_form_display')->resetCache(); $old_form_display = entity_load('entity_form_display', 'node.article.default'); $this->assertFalse($old_form_display); $new_display = entity_load('entity_view_display', 'node.article_rename.default');