SQL migrate id_map plugin should use MigrateMapSaveEvent fields, not the original ones

Created on 2 May 2017, about 7 years ago
Updated 14 November 2023, 7 months ago

Problem/Motivation

Currently, in Sql::saveIdMapping(), Migrate dispatches a MigrateMapSaveEvent right before saving the ID map, passing the map instance and fields.

However, the event includes no way to modify the passed fields, and uses the original fields data, instead of taking them back from the event instance to allow modifying them.

The use case is typicaly Drupal to Drupal: source contains entity data (hence nesting), which the migration handles normally. But the IdMap logic assumes that the source ids are flat values, which they are not to remain consistent with the nested entity export format.

This forces unnatural duplication of the source id columns and irregularity of the migrations using them, to support the limitation of these flat ids.

Steps to reproduce

Proposed resolution

Make the fields modifiable on the event and use $event->getFields() instead of just $fields in the merge() request.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

✨ Feature request
Status

Needs work

Version

11.0 🔥

Component
Migration  →

Last updated about 16 hours ago

Created by

🇫🇷France fgm Paris, France

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.69.0 2024