diff -u b/core/modules/migrate_drupal/tests/fixtures/drupal6.php b/core/modules/migrate_drupal/tests/fixtures/drupal6.php --- b/core/modules/migrate_drupal/tests/fixtures/drupal6.php +++ b/core/modules/migrate_drupal/tests/fixtures/drupal6.php @@ -3422,7 +3422,7 @@ 'field_test_imagefield_fid' => NULL, 'field_test_imagefield_list' => NULL, 'field_test_imagefield_data' => NULL, - 'field_test_text_single_checkbox2_value' => 'Off', + 'field_test_text_single_checkbox2_value' => NULL, )) ->execute(); diff -u b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTest.php b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTest.php --- b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTest.php +++ b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTest.php @@ -85,7 +85,8 @@ $this->assertSame('Buy it now', $node->field_test_link->title); $this->assertSame(['attributes' => ['target' => '_blank']], $node->field_test_link->options); - // Rerun migration with invalid link attributes and a different URL and + // Rerun migration with two source database changes. + // 1. Add an invalid link attributes and a different URL and // title. If only the attributes are changed the error does not occur. Database::getConnection('default', 'migrate') ->update('content_type_story') @@ -98,12 +99,27 @@ ->condition('vid', '3') ->execute(); + // 2. Add an leading slash to an internal link. + Database::getConnection('default', 'migrate') + ->update('content_type_story') + ->fields([ + 'field_test_link_url' => '/node/10', + ]) + ->condition('nid', '9') + ->condition('vid', '12') + ->execute(); + $this->rerunMigration(); $node = Node::load(2); $this->assertIdentical('https://www.drupal.org/node/2127611', $node->field_test_link->uri); $this->assertIdentical('Migrate API in Drupal 8', $node->field_test_link->title); $this->assertIdentical([], $node->field_test_link->options['attributes']); + $node = Node::load(9); + $this->assertSame('internal:/node/10', $node->field_test_link->uri); + $this->assertSame('Buy it now', $node->field_test_link->title); + $this->assertSame(['attributes' => ['target' => '_blank']], $node->field_test_link->options); + // Test that we can re-import using the EntityContentBase destination. $title = $this->rerunMigration(); $node = Node::load(2);