Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By plach on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.0.x
Issue links:
Description:
A langcode
entity key has been added to restore the functionality provided by the language
entity key available in D7. The key value should match the entity language field name, all core entity types use 'langcode'
.
D7:
function node_entity_info() {
$return = array(
'node' => array(
'entity keys' => array(
'id' => 'nid',
'revision' => 'vid',
'bundle' => 'type',
'label' => 'title',
'language' => 'language',
),
// ...
),
);
D8:
/**
* Defines the node entity class.
*
* @ContentEntityType(
* id = "node",
* entity_keys = {
* "id" = "nid",
* "revision" = "vid",
* "bundle" = "type",
* "label" = "title",
* "langcode" = "langcode",
* "uuid" = "uuid"
* },
* ...
* )
*/
class Node extends ContentEntityBase implements NodeInterface {
// ...
}
Impacts:
Module developers