ContentEntityInterface::getTranslation()
returns a new translation if the specified language is valid but there's no corresponding translation for it yet. This is not ideal, we should be creating new translations explicitly. Moreover this has also performance implications, since ContentEntityInterface::addTranslation()
is slow (see also
#2382675: hook_entity_create() affects the data of new translations of existing entities in unexpected and undocumented ways →
).
Remove the ContentEntityInterface::addTranslation()
invocation from ContentEntityInterface::getTranslation()
.
LanguageInterface::LANGUAGE_NOT_SPECIFIED
is passed.None
Yes
None
Fixed
8.0 ⚰️
It affects performance. It is often combined with the Needs profiling tag.
Changes an existing API or subsystem. Not backportable to earlier major versions, unless absolutely required to fix a critical bug.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.