My personally experience with this is when filtering content types but bad data or renaming content types during the migrations could also theoretically cause this problem.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

neclimdul created an issue. See original summary.

phenaproxima’s picture

Status: Active » Needs review
FileSize
1.61 KB
4.43 KB

Try these on for size.

neclimdul’s picture

Status: Needs review » Needs work

Concept looks good!

+++ b/core/modules/field/src/Tests/Migrate/d6/MigrateFieldInstanceTest.php
@@ -98,4 +94,16 @@ public function testFieldInstanceSettings() {
+    $this->sourceDatabase->delete('node_type')
+      ->condition('type', 'test_planet')
+      ->execute();
+    // The field migrations use the migration plugin to ensure that the node
+    // types exist, so this should produce no failures.
+    $this->migrateFields();

Nit, tests that don't assert anything are "risky." We can assert that a field doesn't exist or something to ensure things ran quietly but the value didn't make it.

The last submitted patch, 2: 2588707-2-FAIL.patch, failed testing.

phenaproxima’s picture

Status: Needs work » Needs review
FileSize
4.38 KB

Added a couple of assertions.

neclimdul’s picture

Status: Needs review » Reviewed & tested by the community

Thanks

The last submitted patch, 2: 2588707-2-FAIL.patch, failed testing.

webchick’s picture

Title: CCK field migrations throw exceptions is the destination bundle doesn't exist » CCK field migrations throw exceptions if the destination bundle doesn't exist
Status: Reviewed & tested by the community » Fixed
Issue tags: +rc eligible

I... could not make any heads or tails out of this issue at all. ;)

Adam explained that the problem is if Article node type migration fails, and a field attempts to be migrated later, exceptions ensue. This makes the code more defensive and avoids errors. Makes sense to me.

Since these changes are self-contained against an experimental module, I believe that makes this eligible for commit during RC. Tagging.

Committed and pushed to 8.0.x. Thanks!

  • webchick committed 6aea117 on 8.0.x
    Issue #2588707 by phenaproxima, neclimdul: CCK field migrations throw...
neclimdul’s picture

That pretty much sums it up. Its also a step toward allowing content types to be skipped, or possibly renamed. Just pulling an example out of thin air that surely doesn't apply to me, if you where migrating node profiles onto user fields and didn't want to pull over the profile nodes.

Status: Fixed » Closed (fixed)

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