diff -u b/core/includes/theme.inc b/core/includes/theme.inc --- b/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -2100,7 +2100,7 @@ $variables['base_path'] = base_path(); $variables['front_page'] = url(); $variables['language'] = $language_interface; - $variables['language']->dir = $language_interface->direction ? 'rtl' : 'ltr'; + $variables['language']->dir = $language_interface->getDirection() ? 'rtl' : 'ltr'; $variables['logo'] = theme_get_setting('logo.url'); $variables['site_name'] = (theme_get_setting('features.name') ? String::checkPlain($site_config->get('name')) : ''); $variables['site_slogan'] = (theme_get_setting('features.slogan') ? Xss::filterAdmin($site_config->get('slogan')) : ''); @@ -2123,7 +2123,7 @@ $variables['base_path'] = base_path(); $variables['front_page'] = url(); $variables['language'] = $language_interface; - $variables['language']->dir = $language_interface->getDirection() ? 'rtl' : 'ltr'; + $variables['language']->dir = $language_interface->direction ? 'rtl' : 'ltr'; $variables['logo'] = theme_get_setting('logo.url'); $variables['site_name'] = (theme_get_setting('features.name') ? String::checkPlain($site_config->get('name')) : ''); $variables['site_slogan'] = (theme_get_setting('features.slogan') ? Xss::filterAdmin($site_config->get('slogan')) : ''); diff -u b/core/includes/update.inc b/core/includes/update.inc --- b/core/includes/update.inc +++ b/core/includes/update.inc @@ -13,6 +13,8 @@ use Drupal\Core\Config\FileStorage; use Drupal\Core\Config\ConfigException; use Drupal\Core\DrupalKernel; +use Drupal\Core\Language\Language; +use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Page\DefaultHtmlPageRenderer; use Drupal\Core\Utility\Error; use Drupal\Component\Uuid\Uuid; @@ -829,7 +831,7 @@ $langcode = substr($langcode_config_name, strlen('language.entity.')); $info = \Drupal::config($langcode_config_name)->get(); $languages[$langcode] = new Language(array( - 'default' => ($info['id'] == $default->id), + 'default' => ($info['id'] == $default->getId()), 'name' => $info['label'], 'id' => $info['id'], 'direction' => $info['direction'], @@ -837,13 +839,13 @@ 'weight' => $info['weight'], )); } - LanguageInterface::sort($languages); + uasort($languages, '\Drupal\Core\Language\Language::sort'); } else { // No language module, so use the default language only. - $languages = array($default->id => $default); + $languages = array($default->getId() => $default); // Add the special languages, they will be filtered later if needed. - $languages += \Drupal::languageManager()->getDefaultLockedLanguages($default->weight); + $languages += \Drupal::languageManager()->getDefaultLockedLanguages($default->getWeight()); } } diff -u b/core/lib/Drupal/Core/Language/Language.php b/core/lib/Drupal/Core/Language/Language.php --- b/core/lib/Drupal/Core/Language/Language.php +++ b/core/lib/Drupal/Core/Language/Language.php @@ -219,11 +219,21 @@ /** * Sort language objects. * - * @param array $languages - * The array of language objects keyed by langcode. + * This is a sort() callback. + * + * @param \Drupal\Core\Language\LanguageInterface $a + * @param \Drupal\Core\Language\LanguageInterface $b + * + * @return int + * -1, 0, or 1. */ - public static function sort(&$languages) { - uasort($languages, 'Drupal\Component\Utility\SortArray::sortByWeightAndTitleKey'); + public static function sort(LanguageInterface $a, LanguageInterface $b) { + if ($a->getWeight() == $b->getWeight()) { + return strnatcasecmp($a->getName(), $b->getName()); + } + else { + return $a->getWeight() < $b->getWeight() ? -1 : 1; + } } } diff -u b/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedLanguageTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedLanguageTest.php --- b/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedLanguageTest.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedLanguageTest.php @@ -24,7 +24,7 @@ /** * List of langcodes. * - * @var array + * @var \Drupal\Core\Language\LanguageInterface[] */ protected $langcodes = array(); @@ -58,12 +58,12 @@ /** @var \Drupal\aggregator\FeedInterface[] $feeds */ $feeds = array(); // Create feeds. - $feeds[1] = $this->createFeed(NULL, array('langcode' => $this->langcodes[1]->id)); - $feeds[2] = $this->createFeed(NULL, array('langcode' => $this->langcodes[2]->id)); + $feeds[1] = $this->createFeed(NULL, array('langcode' => $this->langcodes[1]->getId())); + $feeds[2] = $this->createFeed(NULL, array('langcode' => $this->langcodes[2]->getId())); // Make sure that the language has been assigned. - $this->assertEqual($feeds[1]->language()->getId(), $this->langcodes[1]->id); - $this->assertEqual($feeds[2]->language()->getId(), $this->langcodes[2]->id); + $this->assertEqual($feeds[1]->language()->getId(), $this->langcodes[1]->getId()); + $this->assertEqual($feeds[2]->language()->getId(), $this->langcodes[2]->getId()); // Create example nodes to create feed items from and then update the feeds. $this->createSampleNodes(); diff -u b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityTest.php --- b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityTest.php @@ -43,7 +43,7 @@ * Tests CRUD operations. */ function testCRUD() { - $default_langcode = \Drupal::languageManager()->getDefaultLanguage()->id; + $default_langcode = \Drupal::languageManager()->getDefaultLanguage()->getId(); // Verify default properties on a newly created empty entity. $empty = entity_create('config_test'); $this->assertIdentical($empty->id, NULL); diff -u b/core/modules/language/language.module b/core/modules/language/language.module --- b/core/modules/language/language.module +++ b/core/modules/language/language.module @@ -427,13 +427,13 @@ $language->is_new = $language_entity->isNew(); // Assign language properties to language entity. - $language_entity->label = isset($language->name) ? $language->name : ''; - $language_entity->direction = isset($language->direction) ? $language->direction : '0'; - $language_entity->locked = !empty($language->locked); - $language_entity->weight = isset($language->weight) ? $language->weight : 0; + $language_entity->label = $language->getName(); + $language_entity->direction = $language->getDirection(); + $language_entity->locked = $language->isLocked(); + $language_entity->weight = $language->getWeight(); $language_entity->setDefault($language->isDefault()); $language_entity->save(); - $t_args = array('%language' => $language->name, '%langcode' => $language->getId()); + $t_args = array('%language' => $language->getName(), '%langcode' => $language->getId()); if ($language_entity->isNew()) { watchdog('language', 'The %language (%langcode) language has been created.', $t_args); } diff -u b/core/modules/language/lib/Drupal/language/ConfigurableLanguageManager.php b/core/modules/language/lib/Drupal/language/ConfigurableLanguageManager.php --- b/core/modules/language/lib/Drupal/language/ConfigurableLanguageManager.php +++ b/core/modules/language/lib/Drupal/language/ConfigurableLanguageManager.php @@ -291,14 +291,14 @@ $data['default'] = ($langcode == $default->getId()); $data['name'] = $data['label']; $this->languages[$langcode] = new Language($data); - $weight = max(array($weight, $this->languages[$langcode]->weight)); + $weight = max(array($weight, $this->languages[$langcode]->getWeight())); } // Add locked languages, they will be filtered later if needed. $this->languages += $this->getDefaultLockedLanguages($weight); // Sort the language list by weight then title. - LanguageInterface::sort($this->languages); + uasort($this->languages, '\Drupal\Core\Language\Language::sort'); } return parent::getLanguages($flags); diff -u b/core/modules/language/lib/Drupal/language/LanguageNegotiatorInterface.php b/core/modules/language/lib/Drupal/language/LanguageNegotiatorInterface.php --- b/core/modules/language/lib/Drupal/language/LanguageNegotiatorInterface.php +++ b/core/modules/language/lib/Drupal/language/LanguageNegotiatorInterface.php @@ -91,7 +91,7 @@ * // If we are on an administrative path, override with the default * language. * if ($request->query->has('q') && strtok($request->query->get('q'), '/') == 'admin') { - * return $this->languageManager->getDefaultLanguage()->id; + * return $this->languageManager->getDefaultLanguage()->getId(); * } * return $langcode; * } diff -u b/core/modules/language/lib/Drupal/language/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php b/core/modules/language/lib/Drupal/language/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php --- b/core/modules/language/lib/Drupal/language/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php +++ b/core/modules/language/lib/Drupal/language/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php @@ -62,14 +62,14 @@ // Search prefix within enabled languages. $negotiated_language = FALSE; foreach ($languages as $language) { - if (isset($config['prefixes'][$language->id]) && $config['prefixes'][$language->id] == $prefix) { + if (isset($config['prefixes'][$language->getId()]) && $config['prefixes'][$language->getId()] == $prefix) { $negotiated_language = $language; break; } } if ($negotiated_language) { - $langcode = $negotiated_language->id; + $langcode = $negotiated_language->getId(); } break; @@ -78,13 +78,13 @@ $http_host = $request->getHost(); foreach ($languages as $language) { // Skip the check if the language doesn't have a domain. - if (!empty($config['domains'][$language->id])) { + if (!empty($config['domains'][$language->getId()])) { // Ensure that there is exactly one protocol in the URL when // checking the hostname. - $host = 'http://' . str_replace(array('http://', 'https://'), '', $config['domains'][$language->id]); + $host = 'http://' . str_replace(array('http://', 'https://'), '', $config['domains'][$language->getId()]); $host = parse_url($host, PHP_URL_HOST); if ($http_host == $host) { - $langcode = $language->id; + $langcode = $language->getId(); break; } } @@ -133,7 +133,7 @@ $options['language'] = $language_url; } // We allow only enabled languages here. - elseif (!is_object($options['language']) || !isset($languages[$options['language']->id])) { + elseif (!is_object($options['language']) || !isset($languages[$options['language']->getId()])) { return $path; } $config = $this->config->get('language.negotiation')->get('url'); diff -u b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldTest.php --- b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldTest.php @@ -193,14 +193,14 @@ $this->assertEqual(\Drupal::languageManager()->getLanguage(LanguageInterface::LANGCODE_NOT_SPECIFIED), $entity->langcode->language, format_string('%entity_type: Language object can be read.', array('%entity_type' => $entity_type))); // Change the language by code. - $entity->langcode->value = \Drupal::languageManager()->getDefaultLanguage()->id; - $this->assertEqual(\Drupal::languageManager()->getDefaultLanguage()->id, $entity->langcode->value, format_string('%entity_type: Language code can be read.', array('%entity_type' => $entity_type))); + $entity->langcode->value = \Drupal::languageManager()->getDefaultLanguage()->getId(); + $this->assertEqual(\Drupal::languageManager()->getDefaultLanguage()->getId(), $entity->langcode->value, format_string('%entity_type: Language code can be read.', array('%entity_type' => $entity_type))); $this->assertEqual(\Drupal::languageManager()->getDefaultLanguage(), $entity->langcode->language, format_string('%entity_type: Language object can be read.', array('%entity_type' => $entity_type))); // Revert language by code then try setting it by language object. $entity->langcode->value = LanguageInterface::LANGCODE_NOT_SPECIFIED; $entity->langcode->language = \Drupal::languageManager()->getDefaultLanguage(); - $this->assertEqual(\Drupal::languageManager()->getDefaultLanguage()->id, $entity->langcode->value, format_string('%entity_type: Language code can be read.', array('%entity_type' => $entity_type))); + $this->assertEqual(\Drupal::languageManager()->getDefaultLanguage()->getId(), $entity->langcode->value, format_string('%entity_type: Language code can be read.', array('%entity_type' => $entity_type))); $this->assertEqual(\Drupal::languageManager()->getDefaultLanguage(), $entity->langcode->language, format_string('%entity_type: Language object can be read.', array('%entity_type' => $entity_type))); // Access the text field and test updating. diff -u b/core/modules/user/lib/Drupal/user/Plugin/LanguageNegotiation/LanguageNegotiationUserAdmin.php b/core/modules/user/lib/Drupal/user/Plugin/LanguageNegotiation/LanguageNegotiationUserAdmin.php --- b/core/modules/user/lib/Drupal/user/Plugin/LanguageNegotiation/LanguageNegotiationUserAdmin.php +++ b/core/modules/user/lib/Drupal/user/Plugin/LanguageNegotiation/LanguageNegotiationUserAdmin.php @@ -82,7 +82,7 @@ // User preference (only for authenticated users). if ($this->languageManager && $this->currentUser->isAuthenticated() && $this->isAdminPath($request)) { $preferred_admin_langcode = $this->currentUser->getPreferredAdminLangcode(); - $default_langcode = $this->languageManager->getDefaultLanguage()->id; + $default_langcode = $this->languageManager->getDefaultLanguage()->getId(); $languages = $this->languageManager->getLanguages(); if (!empty($preferred_admin_langcode) && $preferred_admin_langcode != $default_langcode && isset($languages[$preferred_admin_langcode])) { $langcode = $preferred_admin_langcode; diff -u b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php --- b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php @@ -185,8 +185,8 @@ $this->assertTrue(($new_user->getCreatedTime() > REQUEST_TIME - 20 ), 'Correct creation time.'); $this->assertEqual($new_user->isActive(), $config_user_settings->get('register') == USER_REGISTER_VISITORS ? 1 : 0, 'Correct status field.'); $this->assertEqual($new_user->getTimezone(), $config_system_date->get('timezone.default'), 'Correct time zone field.'); - $this->assertEqual($new_user->langcode->value, \Drupal::languageManager()->getDefaultLanguage()->id, 'Correct language field.'); - $this->assertEqual($new_user->preferred_langcode->value, \Drupal::languageManager()->getDefaultLanguage()->id, 'Correct preferred language field.'); + $this->assertEqual($new_user->langcode->value, \Drupal::languageManager()->getDefaultLanguage()->getId(), 'Correct language field.'); + $this->assertEqual($new_user->preferred_langcode->value, \Drupal::languageManager()->getDefaultLanguage()->getId(), 'Correct preferred language field.'); $this->assertEqual($new_user->init->value, $mail, 'Correct init field.'); } only in patch2: unchanged: --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTypeTest.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTypeTest.php @@ -66,7 +66,7 @@ public function testCustomBlockTypeCreation() { $this->assertTrue($block_type, 'The new block type has been created.'); // Check that the block type was created in site default language. - $default_langcode = \Drupal::languageManager()->getDefaultLanguage()->id; + $default_langcode = \Drupal::languageManager()->getDefaultLanguage()->getId(); $this->assertEqual($block_type->langcode, $default_langcode); } only in patch2: unchanged: --- a/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php @@ -93,7 +93,7 @@ protected function createTests() { 'id' => 'test_block', 'weight' => NULL, 'status' => TRUE, - 'langcode' => \Drupal::languageManager()->getDefaultLanguage()->id, + 'langcode' => \Drupal::languageManager()->getDefaultLanguage()->getId(), 'dependencies' => array('module' => array('block_test'), 'theme' => array('stark')), 'theme' => 'stark', 'region' => '-1', only in patch2: unchanged: --- a/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php @@ -63,7 +63,7 @@ function testImport() { 'test_dependencies' => array(), 'status' => TRUE, 'uuid' => '30df59bd-7b03-4cf7-bb35-d42fc49f0651', - 'langcode' => \Drupal::languageManager()->getDefaultLanguage()->id, + 'langcode' => \Drupal::languageManager()->getDefaultLanguage()->getId(), 'dependencies' => array(), 'protected_property' => '', ); only in patch2: unchanged: --- a/core/modules/config/lib/Drupal/config/Tests/ConfigImporterTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigImporterTest.php @@ -178,7 +178,7 @@ function testNew() { 'test_dependencies' => array(), 'status' => TRUE, 'uuid' => '30df59bd-7b03-4cf7-bb35-d42fc49f0651', - 'langcode' => \Drupal::languageManager()->getDefaultLanguage()->id, + 'langcode' => \Drupal::languageManager()->getDefaultLanguage()->getId(), 'dependencies' => array(), 'protected_property' => '', ); only in patch2: unchanged: --- a/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php +++ b/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php @@ -124,7 +124,7 @@ function testSiteWideContact() { // Check that the category was created in site default language. $langcode = \Drupal::config('contact.category.' . $id)->get('langcode'); - $default_langcode = \Drupal::languageManager()->getDefaultLanguage()->id; + $default_langcode = \Drupal::languageManager()->getDefaultLanguage()->getId(); $this->assertEqual($langcode, $default_langcode); // Make sure the newly created category is included in the list of categories. only in patch2: unchanged: --- a/core/modules/filter/lib/Drupal/filter/Tests/FilterCrudTest.php +++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterCrudTest.php @@ -84,7 +84,7 @@ function testTextFormatCrud() { */ function verifyTextFormat($format) { $t_args = array('%format' => $format->name); - $default_langcode = \Drupal::languageManager()->getDefaultLanguage()->id; + $default_langcode = \Drupal::languageManager()->getDefaultLanguage()->getId(); // Verify the loaded filter has all properties. $filter_format = entity_load('filter_format', $format->format); only in patch2: unchanged: --- a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php +++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php @@ -300,7 +300,7 @@ private function doAdminTests($user) { 'name' => 'Tags', 'description' => $description, 'vid' => 'tags', - 'langcode' => \Drupal::languageManager()->getDefaultLanguage()->id, + 'langcode' => \Drupal::languageManager()->getDefaultLanguage()->getId(), 'help' => $help, )); $vocabulary->save(); only in patch2: unchanged: --- a/core/modules/forum/lib/Drupal/forum/Tests/ForumUninstallTest.php +++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumUninstallTest.php @@ -42,7 +42,7 @@ function testForumUninstallWithField() { // Create a taxonomy term. $term = entity_create('taxonomy_term', array( 'name' => t('A term'), - 'langcode' => \Drupal::languageManager()->getDefaultLanguage()->id, + 'langcode' => \Drupal::languageManager()->getDefaultLanguage()->getId(), 'description' => '', 'parent' => array(0), 'vid' => 'forums', only in patch2: unchanged: --- a/core/modules/language/lib/Drupal/language/Tests/LanguagePathMonolingualTest.php +++ b/core/modules/language/lib/Drupal/language/Tests/LanguagePathMonolingualTest.php @@ -57,7 +57,7 @@ function setUp() { // Verify that French is the only language. $this->container->get('language_manager')->reset(); $this->assertFalse(\Drupal::languageManager()->isMultilingual(), 'Site is mono-lingual'); - $this->assertEqual(\Drupal::languageManager()->getDefaultLanguage()->id, 'fr', 'French is the default language'); + $this->assertEqual(\Drupal::languageManager()->getDefaultLanguage()->getId(), 'fr', 'French is the default language'); // Set language detection to URL. $edit = array('language_interface[enabled][language-url]' => TRUE); only in patch2: unchanged: --- a/core/modules/language/tests/Drupal/language/Tests/LanguageNegotiationUrlTest.php +++ b/core/modules/language/tests/Drupal/language/Tests/LanguageNegotiationUrlTest.php @@ -38,13 +38,17 @@ public static function getInfo() { public function setUp() { // Set up some languages to be used by the language-based path processor. + $language_de = $this->getMock('\Drupal\Core\Language\LanguageInterface'); + $language_de->expects($this->any()) + ->method('getId') + ->will($this->returnValue('de')); + $language_en = $this->getMock('\Drupal\Core\Language\LanguageInterface'); + $language_en->expects($this->any()) + ->method('getId') + ->will($this->returnValue('en')); $languages = array( - 'de' => (object) array( - 'id' => 'de', - ), - 'en' => (object) array( - 'id' => 'en', - ), + 'de' => $language_de, + 'en' => $language_en, ); // Create a language manager stub. only in patch2: unchanged: --- a/core/modules/user/lib/Drupal/user/Plugin/LanguageNegotiation/LanguageNegotiationUser.php +++ b/core/modules/user/lib/Drupal/user/Plugin/LanguageNegotiation/LanguageNegotiationUser.php @@ -36,7 +36,7 @@ public function getLangcode(Request $request = NULL) { // User preference (only for authenticated users). if ($this->languageManager && $this->currentUser->isAuthenticated()) { $preferred_langcode = $this->currentUser->getPreferredLangcode(); - $default_langcode = $this->languageManager->getDefaultLanguage()->id; + $default_langcode = $this->languageManager->getDefaultLanguage()->getId(); $languages = $this->languageManager->getLanguages(); if (!empty($preferred_langcode) && $preferred_langcode != $default_langcode && isset($languages[$preferred_langcode])) { $langcode = $preferred_langcode; only in patch2: unchanged: --- a/core/modules/user/lib/Drupal/user/Tests/UserInstallTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserInstallTest.php @@ -51,8 +51,8 @@ public function testUserInstall() { $this->assertFalse(empty($anon->uuid), 'Anon user has a UUID'); $this->assertFalse(empty($admin->uuid), 'Admin user has a UUID'); - $this->assertEqual($anon->langcode, \Drupal::languageManager()->getDefaultLanguage()->id, 'Anon user language is the default.'); - $this->assertEqual($admin->langcode, \Drupal::languageManager()->getDefaultLanguage()->id, 'Admin user language is the default.'); + $this->assertEqual($anon->langcode, \Drupal::languageManager()->getDefaultLanguage()->getId(), 'Anon user language is the default.'); + $this->assertEqual($admin->langcode, \Drupal::languageManager()->getDefaultLanguage()->getId(), 'Admin user language is the default.'); $this->assertEqual($admin->status, 1, 'Admin user is active.'); $this->assertEqual($anon->status, 0, 'Anon user is blocked.'); only in patch2: unchanged: --- a/core/modules/user/lib/Drupal/user/Tests/UserRoleAdminTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserRoleAdminTest.php @@ -32,7 +32,7 @@ function setUp() { */ function testRoleAdministration() { $this->drupalLogin($this->admin_user); - $default_langcode = \Drupal::languageManager()->getDefaultLanguage()->id; + $default_langcode = \Drupal::languageManager()->getDefaultLanguage()->getId(); // Test presence of tab. $this->drupalGet('admin/people/permissions'); $tabs = $this->xpath('//ul[@class=:classes and //a[contains(., :text)]]', array( only in patch2: unchanged: --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -1474,7 +1474,7 @@ function _user_mail_notify($op, $account, $langcode = NULL) { if ($op == 'register_pending_approval') { // If a user registered requiring admin approval, notify the admin, too. // We use the site default language for this. - drupal_mail('user', 'register_pending_approval_admin', $site_mail, \Drupal::languageManager()->getDefaultLanguage()->id, $params); + drupal_mail('user', 'register_pending_approval_admin', $site_mail, \Drupal::languageManager()->getDefaultLanguage()->getId(), $params); } } return empty($mail) ? NULL : $mail['result']; only in patch2: unchanged: --- a/core/modules/views/lib/Drupal/views/Tests/Entity/RowEntityRenderersTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Entity/RowEntityRenderersTest.php @@ -63,7 +63,7 @@ protected function setUp() { // The node.view route must exist when nodes are rendered. $this->container->get('router.builder')->rebuild(); - $this->langcodes = array(\Drupal::languageManager()->getDefaultLanguage()->id); + $this->langcodes = array(\Drupal::languageManager()->getDefaultLanguage()->getId()); for ($i = 0; $i < 2; $i++) { $langcode = 'l' . $i; $this->langcodes[] = $langcode;