diff -u b/core/modules/config/src/Tests/ConfigEntityTest.php b/core/modules/config/src/Tests/ConfigEntityTest.php --- b/core/modules/config/src/Tests/ConfigEntityTest.php +++ b/core/modules/config/src/Tests/ConfigEntityTest.php @@ -108,7 +108,7 @@ $this->assertNotEqual($config_test->uuid(), $empty->uuid()); $this->assertIdentical($config_test->label, $expected['label']); $this->assertIdentical($config_test->style, $expected['style']); - $this->assertIdentical($config_test->get('langcode'), $default_langcode); + $this->assertIdentical($config_test->language()->getId(), $default_langcode); // Verify methods on the newly created entity. $this->assertIdentical($config_test->isNew(), TRUE); only in patch2: unchanged: --- a/core/lib/Drupal/Core/Entity/Entity.php +++ b/core/lib/Drupal/Core/Entity/Entity.php @@ -294,7 +294,8 @@ public function language() { $language = $this->languageManager()->getLanguage($this->langcode); if (!$language) { // Make sure we return a proper language object. - $language = new Language(array('id' => LanguageInterface::LANGCODE_NOT_SPECIFIED)); + $langcode = $this->langcode ?: LanguageInterface::LANGCODE_NOT_SPECIFIED; + $language = new Language(array('id' => $langcode)); } return $language; } only in patch2: unchanged: --- a/core/lib/Drupal/Core/Entity/EntityManager.php +++ b/core/lib/Drupal/Core/Entity/EntityManager.php @@ -813,7 +813,7 @@ protected function getAllDisplayModesByEntityType($display_type) { $this->displayModeInfo[$display_type] = array(); foreach ($this->getStorage($display_type)->loadMultiple() as $display_mode) { list($display_mode_entity_type, $display_mode_name) = explode('.', $display_mode->id(), 2); - $this->displayModeInfo[$display_type][$display_mode_entity_type][$display_mode_name] = (array) $display_mode; + $this->displayModeInfo[$display_type][$display_mode_entity_type][$display_mode_name] = $display_mode->toArray(); } $this->moduleHandler->alter($key, $this->displayModeInfo[$display_type]); $this->cacheBackend->set("$key:$langcode", $this->displayModeInfo[$display_type], CacheBackendInterface::CACHE_PERMANENT, array('entity_types' => TRUE, 'entity_field_info' => TRUE));