diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php index e3192b2..13e6f2d 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php @@ -91,8 +91,8 @@ public function setValue($values, $notify = TRUE) { * {@inheritdoc} */ public function applyDefaultValue($notify = TRUE) { - // Default to LANGCODE_NOT_SPECIFIED. - $this->setValue(array('value' => Language::LANGCODE_NOT_SPECIFIED), $notify); + // Default to the current site language. + $this->setValue(array('value' => \Drupal::languageManager()->getCurrentLanguage()->id()), $notify); return $this; } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateAggregatorFeedTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateAggregatorFeedTest.php index 1110f72..5d0295f 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateAggregatorFeedTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateAggregatorFeedTest.php @@ -8,7 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\aggregator\Entity\Feed; -use Drupal\Core\Language\Language; use Drupal\migrate\MigrateExecutable; use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; @@ -52,7 +51,7 @@ public function testAggregatorFeedImport() { $feed = entity_load('aggregator_feed', 5); $this->assertNotNull($feed->uuid()); $this->assertEqual($feed->title->value, 'Know Your Meme'); - $this->assertEqual($feed->language()->id, Language::LANGCODE_NOT_SPECIFIED); + $this->assertEqual($feed->language()->id, 'en'); $this->assertEqual($feed->url->value, 'http://knowyourmeme.com/newsfeed.rss'); $this->assertEqual($feed->refresh->value, 900); $this->assertEqual($feed->checked->value, 1387659487); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateAggregatorItemTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateAggregatorItemTest.php index c5ca816..44cb61d 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateAggregatorItemTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateAggregatorItemTest.php @@ -76,7 +76,8 @@ public function testAggregatorItem() { $this->assertEqual($item->getDescription(), "

What's new with Drupal 8?

"); $this->assertEqual($item->getLink(), 'https://groups.drupal.org/node/395218'); $this->assertEqual($item->getPostedTime(), 1389297196); - $this->assertEqual($item->language()->id, Language::LANGCODE_NOT_SPECIFIED); + $this->assertEqual($item->language()->id, 'en + '); $this->assertEqual($item->getGuid(), '395218 at https://groups.drupal.org'); } diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCommentTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCommentTest.php index 409f6d2..3d2da43 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCommentTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCommentTest.php @@ -76,7 +76,7 @@ public function testComments() { $this->assertEqual(0, $comment->pid->value); $this->assertEqual(1, $comment->entity_id->value); $this->assertEqual('node', $comment->entity_type->value); - $this->assertEqual(Language::LANGCODE_NOT_SPECIFIED, $comment->language()->id); + $this->assertEqual('en', $comment->language()->id); $comment = entity_load('comment', 2); $this->assertEqual('The response to the second comment.', $comment->subject->value); diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCustomBlockTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCustomBlockTest.php index d48acaf..2aacd2f 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCustomBlockTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateCustomBlockTest.php @@ -59,7 +59,7 @@ public function testBlockMigration() { $this->assertEqual('My block 1', $block->label()); $this->assertEqual(1, $block->getRevisionId()); $this->assertTrue(REQUEST_TIME <= $block->getChangedTime() && $block->getChangedTime() <= time()); - $this->assertEqual(Language::LANGCODE_NOT_SPECIFIED, $block->language()->id); + $this->assertEqual('en', $block->language()->id); $this->assertEqual('

My first custom block body

', $block->body->value); $this->assertEqual('full_html', $block->body->format); @@ -67,7 +67,7 @@ public function testBlockMigration() { $this->assertEqual('My block 2', $block->label()); $this->assertEqual(2, $block->getRevisionId()); $this->assertTrue(REQUEST_TIME <= $block->getChangedTime() && $block->getChangedTime() <= time()); - $this->assertEqual(Language::LANGCODE_NOT_SPECIFIED, $block->language()->id); + $this->assertEqual('en', $block->language()->id); $this->assertEqual('

My second custom block body

', $block->body->value); $this->assertEqual('full_html', $block->body->format); }