Problem/Motivation
There are several places in the entity system code assuming that the entity language field is named 'langcode'
. Actually this is just a convention all core entities are respecting, but there's nothing enforcing it, aside from the fact tha things won't work unless your entity language field is properly named. This is not flexible enough and inconsistent with other key fields, such as the entity id or bundle.
Proposed resolution
Introduce a 'langcode'
entity key and use it wherever 'langcode'
is currently hard-coded.
Remaining tasks
- Write a patch
- Review it
User interface changes
None
API changes
Just an API addition.
Comments
Comment #1
plachThis is close to a bug actually, as nothing prevents developers to define language fields having different names from
'langcode'
.Comment #2
plachBetter title
Comment #3
plachDuplicate of #2143729: Entity definitions miss a language entity key.
Comment #4
plach