ID map not copied when cloning row without destination

Created on 23 January 2024, 12 months ago
Updated 23 March 2024, 10 months ago

Problem/Motivation

When calling \Drupal\migrate\Row::cloneWithoutDestination() the cloned row also doesn't have the ID map.

This causes issues when doing e.g. an update of a content entity migration with the overwrite_properties destination setting. \Drupal\migrate\Plugin\migrate\destination\EntityContentBase::updateEntity() will clone the row and later override the previously defined rollback option because the $id_map is empty in \Drupal\migrate\Plugin\migrate\destination\DestinationBase::setRollbackAction()

Steps to reproduce

  1. Create a content entity migration and specify the overwrite_properties destination setting
  2. Import
  3. Check the rollback action in the DB, make sure it's not 1 (preserve)
  4. Import again with the --update option
  5. Check the rollback action in the DB, it's changed to 1 (preserve)

Proposed resolution

Copy the idMap property in the \Drupal\migrate\Row::cloneWithoutDestination() method

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
MigrationΒ  β†’

Last updated about 12 hours ago

Created by

πŸ‡§πŸ‡ͺBelgium matthijs

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024