Handle content type migrations where not all product-display nodes are products

Created on 2 August 2020, over 4 years ago
Updated 21 February 2023, about 2 years ago

Problem/Motivation

Migrating a D7 / Commerce v1 site to D8, one of the content types has ~850 nodes in a content type that has a product reference field, but only about 30 of those 850 are set up as products, the rest were just content. So how should I handle this situation where not all content in the "product" content type is an actual product?

Steps to reproduce

Migrate a D7 site with Commerce v1 where only a subset of nodes which have a product reference field are actual products.

Proposed resolution

TBD

Remaining tasks

TBD

User interface changes

TBD

API changes

TBD

Data model changes

TBD

✨ Feature request
Status

Active

Version

2.0

Component

Drupal Commerce 1.x

Created by

πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    One thing you'll find is that if content type migration for product nodes are removed, to migrate them you need to disable one of the hooks:

    /**
     * Implements hook_module_implements_alter()
     */
    function MYMODULE_module_implements_alter(&$implementations, $hook) {
      // Disable commerce_migrate_commerce_migration_plugins_alter() so that the
      // product content type migration can be used.
      if ($hook == 'hook_migration_plugins_alter') {
        unset($implementations['commerce_migrate_commerce']);
      }
    }
    
Production build 0.71.5 2024