diff -u b/modules/ubercart/commerce_migrate_ubercart.module b/modules/ubercart/commerce_migrate_ubercart.module --- b/modules/ubercart/commerce_migrate_ubercart.module +++ b/modules/ubercart/commerce_migrate_ubercart.module @@ -86,8 +86,9 @@ // so that process can determine which rows to skip, because they are not // the type matching the destination. Two migrations are needed because // d6_language_content_settings has a destination configuration value, - // content_translation_update_definitions, that is not changable in the + // content_translation_update_definitions, that is not changeable in the // process pipeline. + // @todo Update when https://www.drupal.org/node/2930050 is resolved. $migration['process']['product_type'] = [ [ 'plugin' => 'skip_on_empty', diff -u b/modules/ubercart/tests/src/Kernel/Migrate/d6/OrderItemTest.php b/modules/ubercart/tests/src/Kernel/Migrate/d6/OrderItemTest.php --- b/modules/ubercart/tests/src/Kernel/Migrate/d6/OrderItemTest.php +++ b/modules/ubercart/tests/src/Kernel/Migrate/d6/OrderItemTest.php @@ -41,9 +41,15 @@ $this->migrateStore(); $this->startCollectingMessages(); $this->executeMigrations([ + 'language', + 'd6_node_type', + 'd6_ubercart_product_type', + 'd6_language_content_settings', + 'd6_ubercart_language_content_settings', + 'd6_ubercart_product_variation', + 'd6_node', 'd6_ubercart_billing_profile', 'd6_ubercart_order', - 'd6_ubercart_product_variation', 'd6_ubercart_order_product', ]); } diff -u b/modules/ubercart/tests/src/Kernel/Migrate/d6/ProductTest.php b/modules/ubercart/tests/src/Kernel/Migrate/d6/ProductTest.php --- b/modules/ubercart/tests/src/Kernel/Migrate/d6/ProductTest.php +++ b/modules/ubercart/tests/src/Kernel/Migrate/d6/ProductTest.php @@ -62,13 +62,13 @@ * Test product migration from Ubercart 6 to 8. */ public function testProduct() { - $this->assertProductEntity(1, '1', 'Bath Towel', TRUE, ['1'], ['8']); + $this->assertProductEntity(1, '1', 'Bath Towel', TRUE, ['1'], ['7']); $this->assertProductVariationEntity(1, '1', 'towel-bath-001', '20.000000', 'NZD', '1', 'Bath Towel', 'default', '1492867780', NULL); $this->assertProductEntity(2, '1', 'Beach Towel', TRUE, ['1'], ['2']); $this->assertProductVariationEntity(2, '1', 'towel-beach-001', '15.000000', 'NZD', '2', 'Beach Towel', 'default', '1492989418', NULL); - $this->assertProductEntity(3, '1', 'Fairy cake', TRUE, ['1'], ['7']); + $this->assertProductEntity(3, '1', 'Fairy cake', TRUE, ['1'], ['6']); $this->assertProductVariationEntity(3, '1', 'Fairy-Cake-001', '1500.000000', 'NZD', '3', 'Fairy cake', 'default', '1492989703', NULL); // There is only one node in the fixture that is not a product, node 6. diff -u b/src/EventSubscriber/MigrateProduct.php /dev/null --- b/src/EventSubscriber/MigrateProduct.php +++ /dev/null @@ -1,45 +0,0 @@ -getMigration()->getDestinationConfiguration(); - - // Ensure the back reference to the product is correct for all variations - // of this product. -// if ($event->getMigration()->id() == 'd7_commerce_product') { -// $product_id = $event->getRow()->getDestinationProperty('product_id'); -// if ($product = Product::load($product_id)) { -// // Save updates the back-reference on each product variation. -// $product->save(); -// } -// } - } - -} reverted: --- b/tests/src/Kernel/CommerceMigrateTestTrait.php +++ a/tests/src/Kernel/CommerceMigrateTestTrait.php @@ -400,7 +400,7 @@ $this->assertSame($title, $product->getTitle()); $this->assertSame($is_published, $product->isPublished()); $this->assertSame($store_ids, $product->getStoreIds()); + $this->assertSame($variations, $product->getVariationIds()); - //$this->assertSame($variations, $product->getVariationIds()); } /** only in patch2: unchanged: --- a/commerce_migrate.services.yml +++ b/commerce_migrate.services.yml @@ -3,7 +3,3 @@ services: class: Drupal\commerce_migrate\EventSubscriber\MigrateOrderItem tags: - { name: event_subscriber } - commerce_migrate.migrate_product: - class: Drupal\commerce_migrate\EventSubscriber\MigrateProduct - tags: - - { name: event_subscriber } only in patch2: unchanged: --- a/modules/ubercart/migrations/d6_ubercart_order_product.yml +++ b/modules/ubercart/migrations/d6_ubercart_order_product.yml @@ -37,5 +37,5 @@ destination: migration_dependencies: required: - d6_ubercart_order - - d6_ubercart_product + - d6_node - d6_ubercart_product_variation only in patch2: unchanged: --- a/modules/ubercart/tests/src/Kernel/Migrate/d6/PaymentTest.php +++ b/modules/ubercart/tests/src/Kernel/Migrate/d6/PaymentTest.php @@ -57,7 +57,7 @@ class PaymentTest extends Ubercart6TestBase { 'd6_ubercart_billing_profile', 'd6_ubercart_order', 'd6_ubercart_product_variation', - 'd6_ubercart_product', + 'd6_node', 'd6_ubercart_order_product', 'd6_ubercart_payment_gateway', 'd6_ubercart_payment',