Closed (duplicate)
Project:
Drupal core
Version:
8.0.x-dev
Component:
entity system
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
26 Jun 2015 at 11:38 UTC
Updated:
7 Jul 2015 at 20:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
wim leersComment #3
wim leersShould be as simple as adding the
'languages:' . LanguageInterface::TYPE_CONTENTcache context to the failing tests' expectations.Comment #4
wim leersComment #5
berdirAs just discussed with Wim, it's not always the content language that matters here, *only* when langcode is NULL.
We already cache the entity per $language which might or might not depend on the content language. We only know it does in the case where $langcode = NULL, so if we run that code, we need to add the cache context. But not if it langcode is already set, which could for example happen when displaying a list of nodes in their default language.
Comment #6
wim leersSo only in that deepest nested "if", ONLY THEN, we need to add the content language cache context!
Comment #7
wim leersThis was fixed as part of #2512718: EntityManager::getTranslationFromContext() should add the content language cache context to the entity.