diff --git a/core/modules/block/src/BlockViewBuilder.php b/core/modules/block/src/BlockViewBuilder.php index 43bbdbf..c7106aa 100644 --- a/core/modules/block/src/BlockViewBuilder.php +++ b/core/modules/block/src/BlockViewBuilder.php @@ -85,7 +85,7 @@ public function viewMultiple(array $entities = array(), $view_mode = 'full', $la 'entity_view', 'block', $entity->id(), - $entity->langcode, + $entity->get('langcode'), // Blocks are always rendered in a "per theme" cache context. 'cache_context.theme', ); diff --git a/core/modules/block_content/src/Tests/BlockContentTypeTest.php b/core/modules/block_content/src/Tests/BlockContentTypeTest.php index fc20f0c..52e9191 100644 --- a/core/modules/block_content/src/Tests/BlockContentTypeTest.php +++ b/core/modules/block_content/src/Tests/BlockContentTypeTest.php @@ -67,7 +67,7 @@ public function testBlockContentTypeCreation() { // Check that the block type was created in site default language. $default_langcode = \Drupal::languageManager()->getDefaultLanguage()->id; - $this->assertEqual($block_type->langcode, $default_langcode); + $this->assertEqual($block_type->get('langcode'), $default_langcode); } /** diff --git a/core/modules/config/src/Tests/ConfigEntityTest.php b/core/modules/config/src/Tests/ConfigEntityTest.php index 4a1bd1b..c154d99 100644 --- a/core/modules/config/src/Tests/ConfigEntityTest.php +++ b/core/modules/config/src/Tests/ConfigEntityTest.php @@ -49,7 +49,7 @@ function testCRUD() { $this->assertTrue($empty->uuid); $this->assertIdentical($empty->label, NULL); $this->assertIdentical($empty->style, NULL); - $this->assertIdentical($empty->langcode, $default_langcode); + $this->assertIdentical($empty->get('langcode'), $default_langcode); // Verify ConfigEntity properties/methods on the newly created empty entity. $this->assertIdentical($empty->isNew(), TRUE); @@ -108,7 +108,7 @@ function testCRUD() { $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->langcode, $default_langcode); + $this->assertIdentical($config_test->get('langcode'), $default_langcode); // Verify methods on the newly created entity. $this->assertIdentical($config_test->isNew(), TRUE); diff --git a/core/modules/filter/src/Tests/FilterCrudTest.php b/core/modules/filter/src/Tests/FilterCrudTest.php index b592c5f..fe8d2cf 100644 --- a/core/modules/filter/src/Tests/FilterCrudTest.php +++ b/core/modules/filter/src/Tests/FilterCrudTest.php @@ -92,7 +92,7 @@ function verifyTextFormat($format) { $this->assertEqual($filter_format->name, $format->name, format_string('filter_format_load: Proper title for text format %format.', $t_args)); $this->assertEqual($filter_format->weight, $format->weight, format_string('filter_format_load: Proper weight for text format %format.', $t_args)); // Check that the filter was created in site default language. - $this->assertEqual($format->langcode, $default_langcode, format_string('filter_format_load: Proper language code for text format %format.', $t_args)); + $this->assertEqual($format->get('langcode'), $default_langcode, format_string('filter_format_load: Proper language code for text format %format.', $t_args)); } } diff --git a/core/modules/image/image.module b/core/modules/image/image.module index c951dcf..2598f91 100644 --- a/core/modules/image/image.module +++ b/core/modules/image/image.module @@ -419,12 +419,12 @@ function image_field_config_update(FieldConfigInterface $field) { if ($file_new) { $file_new->status = FILE_STATUS_PERMANENT; $file_new->save(); - \Drupal::service('file.usage')->add($file_new, 'image', 'default_image', $field->uuid); + \Drupal::service('file.usage')->add($file_new, 'image', 'default_image', $field->uuid()); } // Is there an old file? if ($fid_old && ($file_old = file_load($fid_old))) { - \Drupal::service('file.usage')->delete($file_old, 'image', 'default_image', $field->uuid); + \Drupal::service('file.usage')->delete($file_old, 'image', 'default_image', $field->uuid()); } } @@ -458,11 +458,11 @@ function image_field_instance_config_update(FieldInstanceConfigInterface $field_ if ($file_new) { $file_new->status = FILE_STATUS_PERMANENT; $file_new->save(); - \Drupal::service('file.usage')->add($file_new, 'image', 'default_image', $field_instance->uuid); + \Drupal::service('file.usage')->add($file_new, 'image', 'default_image', $field_instance->uuid()); } // Delete the old file, if present. if ($fid_old && ($file_old = file_load($fid_old))) { - \Drupal::service('file.usage')->delete($file_old, 'image', 'default_image', $field_instance->uuid); + \Drupal::service('file.usage')->delete($file_old, 'image', 'default_image', $field_instance->uuid()); } } @@ -486,7 +486,7 @@ function image_field_config_delete(FieldConfigInterface $field) { // The value of a managed_file element can be an array if #extended == TRUE. $fid = $field->settings['default_image']['fid']; if ($fid && ($file = file_load($fid))) { - \Drupal::service('file.usage')->delete($file, 'image', 'default_image', $field->uuid); + \Drupal::service('file.usage')->delete($file, 'image', 'default_image', $field->uuid()); } } @@ -505,6 +505,6 @@ function image_field_instance_config_delete(FieldInstanceConfigInterface $field_ // Remove the default image when the instance is deleted. if ($fid && ($file = file_load($fid))) { - \Drupal::service('file.usage')->delete($file, 'image', 'default_image', $field_instance->uuid); + \Drupal::service('file.usage')->delete($file, 'image', 'default_image', $field_instance->uuid()); } } diff --git a/core/modules/menu_link/src/MenuLinkForm.php b/core/modules/menu_link/src/MenuLinkForm.php index 6eee313..3d4e774 100644 --- a/core/modules/menu_link/src/MenuLinkForm.php +++ b/core/modules/menu_link/src/MenuLinkForm.php @@ -174,7 +174,7 @@ public function form(array $form, array &$form_state) { // Without Language module menu links inherit the menu language and no // language selector is shown. else { - $default_langcode = ($menu_link->isNew() ? entity_load('menu', $menu_link->menu_name)->langcode : $menu_link->langcode); + $default_langcode = ($menu_link->isNew() ? entity_load('menu', $menu_link->menu_name)->get('langcode') : $menu_link->langcode); $language_show = FALSE; } diff --git a/core/modules/system/src/Form/DateFormatFormBase.php b/core/modules/system/src/Form/DateFormatFormBase.php index b528edb..2a540d0 100644 --- a/core/modules/system/src/Form/DateFormatFormBase.php +++ b/core/modules/system/src/Form/DateFormatFormBase.php @@ -147,7 +147,7 @@ public function form(array $form, array &$form_state) { '#type' => 'language_select', '#title' => t('Language'), '#languages' => LanguageInterface::STATE_ALL, - '#default_value' => $this->entity->langcode, + '#default_value' => $this->entity->get('langcode'), ); return parent::form($form, $form_state); diff --git a/core/modules/taxonomy/src/VocabularyForm.php b/core/modules/taxonomy/src/VocabularyForm.php index 7287055..8e3b10d 100644 --- a/core/modules/taxonomy/src/VocabularyForm.php +++ b/core/modules/taxonomy/src/VocabularyForm.php @@ -58,7 +58,7 @@ public function form(array $form, array &$form_state) { '#type' => 'language_select', '#title' => $this->t('Vocabulary language'), '#languages' => LanguageInterface::STATE_ALL, - '#default_value' => $vocabulary->langcode, + '#default_value' => $vocabulary->get('langcode'), ); if ($this->moduleHandler->moduleExists('language')) { $form['default_terms_language'] = array( diff --git a/core/modules/user/src/Tests/UserRoleAdminTest.php b/core/modules/user/src/Tests/UserRoleAdminTest.php index 0ddfa73..a7e4fdf 100644 --- a/core/modules/user/src/Tests/UserRoleAdminTest.php +++ b/core/modules/user/src/Tests/UserRoleAdminTest.php @@ -52,7 +52,7 @@ function testRoleAdministration() { $this->assertTrue(is_object($role), 'The role was successfully retrieved from the database.'); // Check that the role was created in site default language. - $this->assertEqual($role->langcode, $default_langcode); + $this->assertEqual($role->get('langcode'), $default_langcode); // Try adding a duplicate role. $this->drupalPostForm('admin/people/roles/add', $edit, t('Save'));