diff --git a/core/lib/Drupal/Core/Entity/EntityViewBuilder.php b/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
index 3dc2d01..3f743eb 100644
--- a/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
+++ b/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
@@ -268,7 +268,8 @@ public function resetCache(array $entities = NULL) {
if (isset($entities)) {
$tags = array();
foreach ($entities as $entity) {
- $tags[$this->entityType][$entity->id()] = $entity->id();
+ $id = $entity->id();
+ $tags[$this->entityType][$id] = $id;
$tags[$this->entityType . '_view_' . $entity->bundle()] = TRUE;
$tags[$this->entityType . '_list_' . $entity->bundle()] = TRUE;
}
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentNonNodeTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentNonNodeTest.php
index 80e4855..abb7c04 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentNonNodeTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentNonNodeTest.php
@@ -307,7 +307,7 @@ function testCommentFunctionality() {
));
// We've changed role permissions, so need to reset render cache.
// @todo Revisit after https://drupal.org/node/2099105
- \Drupal::entityManager()->getViewBuilder('entity_test')->resetCache(array($this->entity->id()));
+ \Drupal::entityManager()->getViewBuilder('entity_test')->resetCache(array($this->entity));
$this->drupalGet('entity_test/' . $this->entity->id());
$this->assertPattern('@
]*>Comments
@', 'Comments were displayed.');
$this->assertLink('Log in', 0, 'Link to log in was found.');
@@ -326,7 +326,7 @@ function testCommentFunctionality() {
));
// We've changed role permissions, so need to reset render cache.
// @todo Revisit after https://drupal.org/node/2099105
- \Drupal::entityManager()->getViewBuilder('entity_test')->resetCache(array($this->entity->id()));
+ \Drupal::entityManager()->getViewBuilder('entity_test')->resetCache(array($this->entity));
$this->drupalGet('entity_test/' . $this->entity->id());
$this->assertNoPattern('@]*>Comments
@', 'Comments were not displayed.');
$this->assertFieldByName('subject', '', 'Subject field found.');
diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityViewControllerTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityViewControllerTest.php
index 8adf8ef..d08d45a 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityViewControllerTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityViewControllerTest.php
@@ -101,7 +101,7 @@ public function testFieldItemAttributes() {
))->save();
// Browse to the entity and verify that the attributes from both modules
// are rendered in the field item HTML markup.
- \Drupal::entityManager()->getViewBuilder('entity_test')->resetCache(array($entity->id()));
+ \Drupal::entityManager()->getViewBuilder('entity_test')->resetCache(array($entity));
$this->drupalGet('entity_test/' . $entity->id());
$xpath = $this->xpath('//div[@data-field-item-attr="foobar" and @property="schema:text" and text()=:value]', array(':value' => $test_value));
$this->assertTrue($xpath, 'The field item attributes from both modules have been found in the rendered output of the field.');