diff --git a/core/lib/Drupal/Core/Entity/ContentEntityBase.php b/core/lib/Drupal/Core/Entity/ContentEntityBase.php index 1d31aff..0f57f7e 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityBase.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityBase.php @@ -142,7 +142,7 @@ public function __construct(array $values, $entity_type, $bundle = FALSE, $trans $this->entityTypeId = $entity_type; $this->bundle = $bundle ? $bundle : $this->entityTypeId; $this->languages = $this->languageManager()->getLanguages(Language::STATE_ALL); - $this->languageKey = $this->getEntityType()->getKey('language'); + $this->languageKey = $this->getEntityType()->getKey('langcode'); foreach ($values as $key => $value) { // If the key matches an existing property set the value to the property diff --git a/core/lib/Drupal/Core/Entity/Entity.php b/core/lib/Drupal/Core/Entity/Entity.php index 2e8812f..542487c 100644 --- a/core/lib/Drupal/Core/Entity/Entity.php +++ b/core/lib/Drupal/Core/Entity/Entity.php @@ -286,7 +286,7 @@ public function access($operation, AccountInterface $account = NULL) { * {@inheritdoc} */ public function language() { - $langcode = $this->{$this->getEntityType()->getKey('language')}; + $langcode = $this->{$this->getEntityType()->getKey('langcode')}; $language = $this->languageManager()->getLanguage($langcode); if (!$language) { // Make sure we return a proper language object. diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php index 10221cd..39aad18 100644 --- a/core/lib/Drupal/Core/Entity/EntityManager.php +++ b/core/lib/Drupal/Core/Entity/EntityManager.php @@ -390,7 +390,7 @@ protected function buildBaseFieldDefinitions($entity_type_id) { if (isset($base_field_definitions[$field_name]) && in_array($key, array('id', 'revision', 'uuid', 'bundle')) && $base_field_definitions[$field_name]->isRevisionable()) { throw new \LogicException(String::format('The @field field cannot be revisionable as it is used as @key entity key.', array('@field' => $base_field_definitions[$field_name]->getLabel(), '@key' => $key))); } - if (isset($base_field_definitions[$field_name]) && in_array($key, array('id', 'revision', 'uuid', 'bundle', 'language')) && $base_field_definitions[$field_name]->isTranslatable()) { + if (isset($base_field_definitions[$field_name]) && in_array($key, array('id', 'revision', 'uuid', 'bundle', 'langcode')) && $base_field_definitions[$field_name]->isTranslatable()) { throw new \LogicException(String::format('The @field field cannot be translatable as it is used as @key entity key.', array('@field' => $base_field_definitions[$field_name]->getLabel(), '@key' => $key))); } } diff --git a/core/lib/Drupal/Core/Entity/EntityType.php b/core/lib/Drupal/Core/Entity/EntityType.php index 3bde57a..b9974c6 100644 --- a/core/lib/Drupal/Core/Entity/EntityType.php +++ b/core/lib/Drupal/Core/Entity/EntityType.php @@ -247,7 +247,7 @@ public function getKeys() { return $this->entity_keys + array( 'revision' => '', 'bundle' => '', - 'language' => '', + 'langcode' => '', ); } diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php index e3a5d34..89f8238 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php @@ -47,7 +47,7 @@ * "id" = "id", * "uuid" = "uuid", * "revision" = "revision_id", - * "language" = "langcode", + * "langcode" = "langcode", * "bundle" = "type", * "label" = "info", * }, diff --git a/core/modules/comment/lib/Drupal/comment/Entity/Comment.php b/core/modules/comment/lib/Drupal/comment/Entity/Comment.php index dd6165d..45db121 100644 --- a/core/modules/comment/lib/Drupal/comment/Entity/Comment.php +++ b/core/modules/comment/lib/Drupal/comment/Entity/Comment.php @@ -41,7 +41,7 @@ * entity_keys = { * "id" = "cid", * "uuid" = "uuid", - * "language" = "langcode", + * "langcode" = "langcode", * "bundle" = "field_id", * "label" = "subject", * }, diff --git a/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php b/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php index 6e20daa..4b478f9 100644 --- a/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php +++ b/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php @@ -37,7 +37,7 @@ * "label" = "link_title", * "uuid" = "uuid", * "bundle" = "bundle", - * "language" = "langcode", + * "langcode" = "langcode", * }, * ) */ diff --git a/core/modules/node/lib/Drupal/node/Entity/Node.php b/core/modules/node/lib/Drupal/node/Entity/Node.php index ff79ada..82d7b82 100644 --- a/core/modules/node/lib/Drupal/node/Entity/Node.php +++ b/core/modules/node/lib/Drupal/node/Entity/Node.php @@ -45,7 +45,7 @@ * "id" = "nid", * "uuid" = "uuid", * "revision" = "vid", - * "language" = "langcode", + * "langcode" = "langcode", * "default_language" = "default_langcode", * "bundle" = "type", * "label" = "title", diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Entity/Shortcut.php b/core/modules/shortcut/lib/Drupal/shortcut/Entity/Shortcut.php index 42de480..f00f8d1 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/Entity/Shortcut.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/Entity/Shortcut.php @@ -35,7 +35,7 @@ * entity_keys = { * "id" = "id", * "uuid" = "uuid", - * "language" = "langcode", + * "langcode" = "langcode", * "default_language" = "default_langcode", * "bundle" = "shortcut_set", * "label" = "title", diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php index 1ec6737..ad66aed 100644 --- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php +++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php @@ -37,7 +37,7 @@ * "id" = "id", * "uuid" = "uuid", * "bundle" = "type", - * "language" = "langcode", + * "langcode" = "langcode", * "label" = "name", * }, * links = { diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestMul.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestMul.php index abe181e..30bfbb3 100644 --- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestMul.php +++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestMul.php @@ -32,7 +32,7 @@ * entity_keys = { * "id" = "id", * "uuid" = "uuid", - * "language" = "langcode", + * "langcode" = "langcode", * "default_language" = "default_langcode", * "bundle" = "type", * "label" = "name", diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestMulRev.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestMulRev.php index 39cc529..da682a8 100644 --- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestMulRev.php +++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestMulRev.php @@ -34,7 +34,7 @@ * "id" = "id", * "uuid" = "uuid", * "revision" = "revision_id", - * "language" = "langcode", + * "langcode" = "langcode", * "default_language" = "default_langcode", * "bundle" = "type", * }, diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestRev.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestRev.php index 2a263d1..95f8856 100644 --- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestRev.php +++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestRev.php @@ -31,7 +31,7 @@ * "id" = "id", * "uuid" = "uuid", * "revision" = "revision_id", - * "language" = "langcode", + * "langcode" = "langcode", * "bundle" = "type", * "label" = "name", * }, diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Term.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Term.php index f1adde3..e4c4d64 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Term.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Term.php @@ -39,7 +39,7 @@ * entity_keys = { * "id" = "tid", * "uuid" = "uuid", - * "language" = "langcode", + * "langcode" = "langcode", * "bundle" = "vid", * "label" = "name", * }, diff --git a/core/modules/user/lib/Drupal/user/Entity/User.php b/core/modules/user/lib/Drupal/user/Entity/User.php index 9a427e0..b788863 100644 --- a/core/modules/user/lib/Drupal/user/Entity/User.php +++ b/core/modules/user/lib/Drupal/user/Entity/User.php @@ -42,7 +42,7 @@ * entity_keys = { * "id" = "uid", * "uuid" = "uuid", - * "language" = "langcode", + * "langcode" = "langcode", * }, * links = { * "canonical" = "user.view", diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php index 6984216..98afaf1 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php @@ -82,9 +82,9 @@ public function testHasKey($entity_keys, $expected) { */ public function providerTestGetKeys() { return array( - array(array(), array('revision' => '', 'bundle' => '', 'language' => '')), - array(array('id' => 'id'), array('id' => 'id', 'revision' => '', 'bundle' => '', 'language' => '')), - array(array('bundle' => 'bundle'), array('bundle' => 'bundle', 'revision' => '', 'language' => '')), + array(array(), array('revision' => '', 'bundle' => '', 'langcode' => '')), + array(array('id' => 'id'), array('id' => 'id', 'revision' => '', 'bundle' => '', 'langcode' => '')), + array(array('bundle' => 'bundle'), array('bundle' => 'bundle', 'revision' => '', 'langcode' => '')), ); }