When trying to set product variant references during a product display migration using the latest DEV branch of 7.x, as well as the patched version of 7.x-1.2 that ships with Commerce Kickstart 7.x-2.43, two problems occur:
This problem does NOT occur for Commerce Migrate 7.x-1.2. That version of the module migrates both single and multi-sku products correctly.
The problem appears to be related to the patch from https://www.drupal.org/node/2701333 → . The patch updates MigrateCommerceProductReferenceFieldHandler to extend MigrateSimpleFieldHandler in place of custom logic previously applied to MigrateFieldHandler. This patch appears to have been implemented in 7.x-1.x-dev, and it has been applied to the 7.x-1.2 stable version that comes with Commerce Kickstart. In both cases, my migration fails the same way when using either version to migrate products. However, when I switch to the unpatched 7.x-1.2 version, the migration happens without errors.
For my migration, I have one product display that aggregates three different variant types, so the product reference field mapping includes a sourceMigration() consisting of an array of three previous variant migrations. Not sure if that is relevant here, but figured I'd mention it.
I have NOT yet tried the solution in this bug report: https://www.drupal.org/node/2405869 → . That workaround appears to bypass sourceMigration() entirely by looking up the Drupal ID of the previously migrated SKUs by their SKU value within the prepareRow() method. That might be a solution, but it's not ideal because it should not be necessary: sourceMigration() is supposed to do this for you when setting up entity reference fields in general.
Closed: outdated
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.