MigrateField plugin commerce_customer_profile_reference prevents use of custom profile migration

Created on 8 March 2021, over 3 years ago
Updated 27 July 2023, over 1 year ago

Problem/Motivation

The MigrateField plugin commerce_customer_profile_reference overwrites the process plugin configuration for the billing_profile field on an order migration. In CommerceCustomerProfileReference::defineValueProcessPipeline():

  public function defineValueProcessPipeline(MigrationInterface $migration, $field_name, $data) {
    $destination_field_name = isset($this->fieldNameMap[$field_name]) ? $this->fieldNameMap[$field_name] : $field_name;
    $process = [
      'plugin' => 'commerce_migrate_commerce_reference_revision',
      'migration' => 'commerce1_profile',
      'source' => $field_name,
      'no_stub' => TRUE,
    ];
    dump("I IZ HACKING YR MIGRATION");
    $migration->setProcessOfProperty($destination_field_name, $process);
  }

The problem with doing this is that a custom order migration can't reference a custom profile migration, because it gets overwritten. In my migration, I have this:

  billing_profile:
    plugin: commerce_migrate_commerce_reference_revision
    migration: my_commerce_profile
    source: commerce_customer_billing
    no_stub: true

That's because I need a custom profile migration my_commerce_profile which itself needs to reference a custom user migration.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs review

Version

3.2

Component

Drupal Commerce 1.x

Created by

🇬🇧United Kingdom joachim

Live updates comments and jobs are added and updated live.
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.

Production build 0.71.5 2024