Problem/Motivation

It was discovered in #2746541: Migrate D6 and D7 node revision translations to D8 that the drupal6 database base dump has an error. mikelutz has changed the times of the revisions for node 1 and explained those changes in comment #365, repeated here for convenience.

#305.12 This changed because the original d6 fixture was weird.
Originally, in the node table you had node 1, Revision id 1, created time 1388271197. changed time 1420861423
in the node revision table you had node 1 revision 1 timestamp 1420861423 and node 1, revision 2001, timestamp 1390095702. It made no sense, the latest revision timestamp was earlier than the first revision timestamp, and the node and revision tables don't match. I swapped the first and last timestamps, and set the node table to match, though I see now the node table still lists the revision for node 1 as revision 1 when it should be revision 2001, and I don't know how changing that will affect other tests.

MariaDB [d6_dump]> select nid,vid,timestamp from node_revisions where nid = 1;
+-----+------+------------+
| nid | vid  | timestamp  |
+-----+------+------------+
|   1 |    1 | 1390095702 |  **
|   1 |    5 | 1390095703 |
|   1 | 2001 | 1420861423 |
+-----+------+------------+
3 rows in set (0.000 sec)
MariaDB [d6_dump]> select nid,vid,created,changed from node where nid = 1;
+-----+-----+------------+------------+
| nid | vid | created    | changed    |
+-----+-----+------------+------------+
|   1 |   1 | 1390095702 | 1420861423 |
+-----+-----+------------+------------+
1 row in set (0.000 sec)

** Note the timestamp changed from 1388271197 to 1390095702 in #2746541: Migrate D6 and D7 node revision translations to D8

Proposed resolution

Keep all the changes to node 1 from #2746541: Migrate D6 and D7 node revision translations to D8 and then change the latest revision from 1 to 2001, which is the latest revision. Also, add field data for revisions 5 and 2001 for all fields on node 1. Some texts needed to change as well, such as where the title included the revision number. And then update the d6 MigrateNodeTest.php and MigrateNodeRevisionTest.php.

MariaDB [d6_dump]> select nid,vid,created,changed from node where nid = 1;
+-----+------+------------+------------+
| nid | vid  | created    | changed    |
+-----+------+------------+------------+
|   1 | 2001 | 1390095702 | 1420861423 |
+-----+------+------------+------------+
1 row in set (0.001 sec)

Remaining tasks

Fix the failing tests.

CommentFileSizeAuthor
#39 3116841-39.patch12.25 KBquietone
#39 diff-27-39.txt203 bytesquietone
#27 3116841-27.patch12.24 KBquietone
#27 interdiff-22-27.txt887 bytesquietone
#22 3116841-22.patch12.24 KBquietone
#22 diff-18-22.txt374 bytesquietone
#18 interdiff-16-18.txt829 bytesquietone
#18 3116841-18.patch12.25 KBquietone
#16 interdiff-14-16.txt1.04 KBquietone
#16 3116841-16.patch12.17 KBquietone
#14 3116841-14.patch13.21 KBquietone
#14 diff-10-14.txt5.31 KBquietone
#10 interdiff-8-10.txt1.04 KBquietone
#10 3116841-10.patch17.17 KBquietone
#8 interdiff-6-8.txt854 bytesquietone
#8 3116841-8.patch16.13 KBquietone
#6 interdiff_4-6.txt543 bytesswatichouhan012
#6 3116841-6.patch16.26 KBswatichouhan012
#4 3116841-4.patch15.57 KBquietone
#4 interdiff-2-4.txt11 KBquietone
#2 3116841-2.patch4.42 KBquietone
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quietone created an issue. See original summary.

quietone’s picture

Status: Active » Needs review
FileSize
4.42 KB

Made a start on fixing MigrateNodeTest.

Status: Needs review » Needs work

The last submitted patch, 2: 3116841-2.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
Issue tags: +migrate-d6-d8
FileSize
11 KB
15.57 KB

Adding more revision data for fields and update revision test to test the correct revision values.

Status: Needs review » Needs work

The last submitted patch, 4: 3116841-4.patch, failed testing. View results

swatichouhan012’s picture

Status: Needs work » Needs review
FileSize
16.26 KB
543 bytes

Correct comment config entities.

Status: Needs review » Needs work

The last submitted patch, 6: 3116841-6.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
FileSize
16.13 KB
854 bytes

Add revisions to the 'upload' table.

Status: Needs review » Needs work

The last submitted patch, 8: 3116841-8.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
FileSize
17.17 KB
1.04 KB

The number of comments has changed?

quietone’s picture

Issue summary: View changes

Update IS.

The only thing I don't understand is why the number of comments has been reduced by 1.

This is ready for review.

quietone’s picture

Regarding comments, none of the comments in the fixture are linked to node 1.

mikelutz’s picture

Status: Needs review » Needs work

Yeah, the comment count seems wrong, I noticed that one of the comments comes over as the 'comment' bundle, instead of the story specific comment bundle, This definitly needs more work, I'll try to investigate further.

quietone’s picture

Status: Needs work » Needs review
FileSize
5.31 KB
13.21 KB

Needed a reroll

Status: Needs review » Needs work

The last submitted patch, 14: 3116841-14.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
FileSize
12.17 KB
1.04 KB

Hmm, that is unexpected. I can't explain why the comment entity count changed but this remove the changes made in #10 regarding the count and try again.

Status: Needs review » Needs work

The last submitted patch, 16: 3116841-16.patch, failed testing. View results

quietone’s picture

The revision creation time has changed for node 1, since it is now revision '2001' instead of revision '1'.

->values(array(
  'nid' => '1',
  'vid' => '2001',
  'uid' => '2',
  'title' => 'Test title rev 3',
  'body' => 'body test rev 3',
  'teaser' => 'teaser test rev 3',
  'log' => 'modified rev 3',
  'timestamp' => '1420861423',
  'format' => '1',
))

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

mikelutz’s picture

Status: Needs review » Reviewed & tested by the community

rtbc

quietone’s picture

Issue tags: +Needs reroll

Bummer, this needs a reroll.

quietone’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: -Needs reroll
FileSize
374 bytes
12.24 KB

Reroll for 9.1.x. No changes to the fixture, just d6/MigrateNodeTest

quietone’s picture

quietone’s picture

Retesting

quietone’s picture

Category: Task » Bug report
Issue tags: +Bug Smash Initiative

This is actually a bug.

dww’s picture

1 new CS violoation:

/var/lib/drupalci/workspace/jenkins-drupal_patches-55597/source/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTest.php ✗ 1 more
line 63	Empty PHP statement detected: superfluous semi-colon.
+++ b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTest.php
@@ -52,24 +52,24 @@ public function testNode() {
+    $this->assertIdentical('1420861423', $node->getRevisionCreationTime());;

Extra semicolon here.

Otherwise, seems RTBC to me. I'm only recently in touch with this test, so I'm no expert...

quietone’s picture

@dww, thank you and apologies , I shouldn't seen that myself.

dww’s picture

Bot's happy.
Tests pass.
No more CS violations.
Changes in the patch look consistent with the issue summary.

I could complain that if we're already changing assertions like this:

+++ b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTest.php
@@ -52,24 +52,24 @@ public function testNode() {
+    $this->assertIdentical('Test title rev 3', $node->getTitle(), 'Node has the correct title.');
...
+    $this->assertIdentical('2', $node_revision->getRevisionUser()->id(), 'Node revision has the correct user');

...that we should strip the pointless 3rd message argument. But that's arguably out of scope. We'll clean all that up in other issues.

Therefore, RTBC.

Thanks,
-Derek

larowlan’s picture

I took a look at this but have no idea what I'm looking at 😵

I'll ping @quietone to walk me through this tomorrow.

dww’s picture

For the record, this patch is also making it consistent so that vid 5 always belongs to nid 1. E.g. currently (in Git, prior to the patch) we have:

~line 45316

->values(array(
  'nid' => '1',
  'vid' => '5',
  'uid' => '1',
  'title' => 'Test title rev 2',
  'body' => 'body test rev 2',
  'teaser' => 'teaser test rev 2',
  'log' => 'modified rev 2',
  'timestamp' => '1390095703',
  'format' => '1',
))

vs. a few spots where it's nid '2' (touched by the patch). E.g.:

~line 2404

->values(array(
  'vid' => '5',
  'nid' => '2',
  'field_test_value' => NULL,
  'field_test_format' => NULL,
))

...

quietone’s picture

Issue summary: View changes

Minor changes to IS

quietone’s picture

Issue summary: View changes
jungle’s picture

+++ b/core/modules/migrate_drupal/tests/fixtures/drupal6.php
@@ -2274,6 +2274,20 @@
+->values(array(
...
+))
+->values(array(
...
+))

@@ -2413,6 +2421,12 @@
+->values(array(
...
+))

@@ -48083,6 +48114,16 @@
+->values(array(
...
+))
...
+))

@@ -48291,6 +48340,14 @@
+->values(array(
...
+))

Should we replace array() with []?

quietone’s picture

@jungle, not in this case. That database fixtures drupal6.php and drupal7.php are created by the script core/scripts/db-tools.

larowlan’s picture

  • larowlan committed ba77d3f on 9.1.x
    Issue #3116841 by quietone, swatichouhan012, dww, mikelutz: Correct...
larowlan’s picture

Title: Correct latest revision for node 1 in drupal6 test fixture » [backport] Correct latest revision for node 1 in drupal6 test fixture
Version: 9.1.x-dev » 8.9.x-dev

Committed ba77d3f and pushed to 9.1.x. Thanks!

c/p to 9.0.x

Queuing an 8.9.x test

  • larowlan committed f434a9d on 9.0.x
    Issue #3116841 by quietone, swatichouhan012, dww, mikelutz: Correct...
quietone’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
203 bytes
12.25 KB

Rerolled for 8.9.x

dww’s picture

Status: Needs review » Reviewed & tested by the community

Re-roll looks good. Back to RTBC.

Thanks!
-Derek

alexpott’s picture

Title: [backport] Correct latest revision for node 1 in drupal6 test fixture » Correct latest revision for node 1 in drupal6 test fixture
Status: Reviewed & tested by the community » Fixed

Committed 67b02fd and pushed to 8.9.x. Thanks!

  • alexpott committed 67b02fd on 8.9.x
    Issue #3116841 by quietone, swatichouhan012, dww, larowlan, mikelutz:...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.