diff --git a/core/lib/Drupal/Core/Entity/EntityViewBuilder.php b/core/lib/Drupal/Core/Entity/EntityViewBuilder.php index 4024537..97373e3 100644 --- a/core/lib/Drupal/Core/Entity/EntityViewBuilder.php +++ b/core/lib/Drupal/Core/Entity/EntityViewBuilder.php @@ -202,7 +202,7 @@ protected function getBuildDefaults(EntityInterface $entity, $view_mode, $langco // entities. Hence no work is necessary in this case. // 2. $langcode is set to a specific value when calling ::view() or // ::viewMultiple() and therefore doesn't match the negotiated content - // language. In that case, the "content language" cache context set by + // language. In that case, the "content language" cache context set by // the entity would be *wrong*. Thus, the "content language" cache // context is removed and a cache key is added instead. if ($langcode !== $this->languageManager->getCurrentLanguage(LanguageInterface::TYPE_CONTENT)->getId()) { diff --git a/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php b/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php index 94c98ad..c676689 100644 --- a/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php +++ b/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php @@ -453,20 +453,16 @@ public function testInheritCacheability() { $access = AccessResult::allowed(); $other = AccessResult::allowed()->setCacheMaxAge(1500)->cachePerPermissions()->addCacheTags(['node:20011988']); $this->assertTrue($access->inheritCacheability($other) instanceof AccessResult); - $this->assertTrue($access->isCacheable()); $this->assertSame(['user.permissions'], $access->getCacheContexts()); $this->assertSame(['node:20011988'], $access->getCacheTags()); - $this->assertSame('default', $access->getCacheBin()); $this->assertSame(1500, $access->getCacheMaxAge()); // andIf(); 1st has custom tags, max-age, 2nd has custom contexts and max-age. $access = AccessResult::allowed()->cachePerUser()->setCacheMaxAge(43200); $other = AccessResult::forbidden()->addCacheTags(['node:14031991'])->setCacheMaxAge(86400); $this->assertTrue($access->inheritCacheability($other) instanceof AccessResult); - $this->assertTrue($access->isCacheable()); $this->assertSame(['user'], $access->getCacheContexts()); $this->assertSame(['node:14031991'], $access->getCacheTags()); - $this->assertSame('default', $access->getCacheBin()); $this->assertSame(43200, $access->getCacheMaxAge()); } @@ -477,17 +473,17 @@ public function testInheritCacheability() { * every single bit of cacheability metadata, which would lead to a mind- * boggling number of permutations, in this test, we only consider the * permutations of all pairs of the following set: - * 1. Allowed, implements CDI, is cacheable - * 2. Allowed, implements CDI, is not cacheable - * 3. Allowed, does not implement CDI (hence not cacheable) - * 4. Forbidden, implements CDI, is cacheable - * 5. Forbidden, implements CDI, is not cacheable - * 6. Forbidden, does not implement CDI (hence not cacheable) - * 7. Neutral, implements CDI, is cacheable - * 8. Neutral, implements CDI, is not cacheable - * 9. Neutral, does not implement CDI (hence not cacheable) + * 1. Allowed, implements CDI, is cacheable. + * 2. Allowed, implements CDI, is not cacheable. + * 3. Allowed, does not implement CDI (hence not cacheable). + * 4. Forbidden, implements CDI, is cacheable. + * 5. Forbidden, implements CDI, is not cacheable. + * 6. Forbidden, does not implement CDI (hence not cacheable). + * 7. Neutral, implements CDI, is cacheable. + * 8. Neutral, implements CDI, is not cacheable. + * 9. Neutral, does not implement CDI (hence not cacheable). * - * (Where "CDI" is CacheableDependencyInterface.) + * (Where "CDI" is CacheableDependencyInterface). * * This leads to 72 permutations (9!/(9-2)! = 9*8 = 72) per operation. There * are two operations to test (AND and OR), so that leads to a grand total of