Still working out what's happening here but it seems that if a node migrations failed because of something like an integrity constraint failure(node title being empty of some bug in a migration) then the term_node migration will try to modify the node that doesn't exist and write it. Which will fail with an integrity constraint on the empty title.

Testing a patch to confirm this to be the case.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

neclimdul created an issue. See original summary.

phenaproxima’s picture

Added a bit of defensiveness to the d6_term_node and d6_term_node_revision migrations. Still needs tests, but I expect this will help.

phenaproxima’s picture

I worked very, very hard and I think I deserve a test.

A test?

A test.

mikeryan’s picture

+++ b/core/modules/taxonomy/src/Tests/Migrate/d6/MigrateTermNodeTest.php
@@ -51,4 +55,28 @@ public function testTermNode() {
+    $node = $this->sourceDatabase->select('node', 'n')
+      ->fields('n')
+      ->condition('nid', 2)
+      ->execute()
+      ->fetchAssoc();
+    $row = new Row($node, $migration->getSourcePlugin()->getIds());

$node does not need to be fully populated, ['nid' => 2] will do.

Other than that, looks good for what it does. I'll repeat what I've said previously, though - we should not have separate term_node* migrations, term references should be migrated as part of the node migration just like any other field. This bug fix holds us over until we address that (I'll open an issue).

phenaproxima’s picture

Moved the gnarly set-up stuff in testSkipNonExistentNode() into a helper method of MigrateTestBase. I think this is a scenario we may want to test again, so it makes sense to have a helper for that. Also addressed @mikeryan's comment above.

mikeryan’s picture

Status: Needs review » Reviewed & tested by the community
Related issues: +#2597650: Term references should be incorporated into D6 node migration

RTBC pending successful automated tests.

Added issue for merging term_node into node migrations: #2597650: Term references should be incorporated into D6 node migration.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.0.x. Thanks!

  • webchick committed 4e760c3 on 8.0.x
    Issue #2588945 by phenaproxima, mikeryan, neclimdul: term_node migration...

Status: Fixed » Closed (fixed)

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