From d4eb909c2394adc1f9552bc1f19b98c2c0c3333f Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Mon, 6 Aug 2018 23:38:10 +0100
Subject: [PATCH] Issue #2934799 by maxocub, Olarin, heddn, dww:
 d6_term_node_revision migration ignores a lot of items that it shouldn't

---
 .../migrate_drupal/tests/fixtures/drupal6.php | 26 +++++++++----------
 .../Migrate/d6/MigrateNodeRevisionTest.php    |  4 +--
 .../migrations/d6_term_node_revision.yml      |  2 +-
 .../d6/MigrateTermNodeRevisionTest.php        |  2 +-
 4 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/core/modules/migrate_drupal/tests/fixtures/drupal6.php b/core/modules/migrate_drupal/tests/fixtures/drupal6.php
index 5793fd36f2ce..d9b1c2cd72af 100644
--- a/core/modules/migrate_drupal/tests/fixtures/drupal6.php
+++ b/core/modules/migrate_drupal/tests/fixtures/drupal6.php
@@ -44160,17 +44160,6 @@
   'timestamp' => '1420861423',
   'format' => '1',
 ))
-->values(array(
-  'nid' => '1',
-  'vid' => '2',
-  'uid' => '2',
-  'title' => 'Test title rev 2',
-  'body' => 'body test rev 2',
-  'teaser' => 'teaser test rev 2',
-  'log' => 'modified rev 2',
-  'timestamp' => '1390095702',
-  'format' => '1',
-))
 ->values(array(
   'nid' => '2',
   'vid' => '3',
@@ -44402,6 +44391,17 @@
   'timestamp' => '1520613305',
   'format' => '1',
 ))
+->values(array(
+  'nid' => '1',
+  'vid' => '2001',
+  'uid' => '2',
+  'title' => 'Test title rev 2',
+  'body' => 'body test rev 2',
+  'teaser' => 'teaser test rev 2',
+  'log' => 'modified rev 2',
+  'timestamp' => '1390095702',
+  'format' => '1',
+))
 ->execute();
 
 $connection->schema()->createTable('node_type', array(
@@ -46835,12 +46835,12 @@
 ))
 ->values(array(
   'nid' => '1',
-  'vid' => '2',
+  'vid' => '2001',
   'tid' => '4',
 ))
 ->values(array(
   'nid' => '1',
-  'vid' => '2',
+  'vid' => '2001',
   'tid' => '5',
 ))
 ->values(array(
diff --git a/core/modules/node/tests/src/Functional/Migrate/d6/MigrateNodeRevisionTest.php b/core/modules/node/tests/src/Functional/Migrate/d6/MigrateNodeRevisionTest.php
index 075e72767892..4065278bcfbb 100644
--- a/core/modules/node/tests/src/Functional/Migrate/d6/MigrateNodeRevisionTest.php
+++ b/core/modules/node/tests/src/Functional/Migrate/d6/MigrateNodeRevisionTest.php
@@ -28,10 +28,10 @@ protected function setUp() {
    * Test node revisions migration from Drupal 6 to 8.
    */
   public function testNodeRevision() {
-    $node = \Drupal::entityManager()->getStorage('node')->loadRevision(2);
+    $node = \Drupal::entityManager()->getStorage('node')->loadRevision(2001);
     /** @var \Drupal\node\NodeInterface $node */
     $this->assertIdentical('1', $node->id());
-    $this->assertIdentical('2', $node->getRevisionId());
+    $this->assertIdentical('2001', $node->getRevisionId());
     $this->assertIdentical('und', $node->langcode->value);
     $this->assertIdentical('Test title rev 2', $node->getTitle());
     $this->assertIdentical('body test rev 2', $node->body->value);
diff --git a/core/modules/taxonomy/migrations/d6_term_node_revision.yml b/core/modules/taxonomy/migrations/d6_term_node_revision.yml
index 2edf86054dad..9487984f9408 100644
--- a/core/modules/taxonomy/migrations/d6_term_node_revision.yml
+++ b/core/modules/taxonomy/migrations/d6_term_node_revision.yml
@@ -11,7 +11,7 @@ process:
   vid:
     -
       plugin: migration_lookup
-      migration: d6_node
+      migration: d6_node_revision
       source: vid
     -
       plugin: skip_on_empty
diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeRevisionTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeRevisionTest.php
index 614725d966ec..25544486ab28 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeRevisionTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeRevisionTest.php
@@ -31,7 +31,7 @@ protected function setUp() {
    * Tests the Drupal 6 term-node revision association to Drupal 8 migration.
    */
   public function testTermRevisionNode() {
-    $node = \Drupal::entityManager()->getStorage('node')->loadRevision(2);
+    $node = \Drupal::entityManager()->getStorage('node')->loadRevision(2001);
     $this->assertSame(2, count($node->field_vocabulary_3_i_2_));
     $this->assertSame('4', $node->field_vocabulary_3_i_2_[0]->target_id);
     $this->assertSame('5', $node->field_vocabulary_3_i_2_[1]->target_id);
-- 
GitLab