Problem/Motivation

The various kinds of plugins should not talk to each other. MigrateExecutable weaves them together but they don't talk to each other. #2598696: Rollback should not delete uid 1 leaks Sql idMap specific implementation details into the destination "sourceid1" and $id_map['rollback_action']. sourceid1 is not something the idMapInterface guarantees to exist. I am a bit baffled by how the usage here because lookupSourceID will key by the id propery instead of "sourceid1" so I have no idea how that even leaked. That's another bug, whatever leaks sourceid1 from Sql idmap needs to be fixed.

To simplify:

core/modules/migrate/src/Plugin/migrate/destination/DestinationBase.php:103:    if (isset($id_map['sourceid1'])) {

shouldn't be in DestinationBase.

Proposed resolution

I do not understand what's happening but such leaks need to be plugged.

If need to get the destination plugin involved then have the MigrateExecutable pass the data much like it does on import.

But I will be honest and say: I do not fully grasp why did destination got involved in the first place. There's no destination plugin overriding setRollbackAction. So... why is this in destination?

Remaining tasks

User interface changes

API changes

Data model changes

Comments

chx created an issue. See original summary.

webchick’s picture

Status: Active » Postponed (maintainer needs more info)

Still don't understand what was architecturally broken about the previous patch, and the issue title/summary here sadly don't help.

chx’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Active
chx’s picture

Issue summary: View changes

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

heddn’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Needs issue summary update

Needs an issue summary update.

chx’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Active

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mikeryan’s picture

Title: Properly fix https://www.drupal.org/node/2598696 » Decouple idmap from destination plugin
Priority: Major » Normal

The issue summary is still not entirely clear. As far as 'sourceid1' goes, in my mind, sourceid* and destid* are part of the idmap interface - if we were to implement an idmap with a non-SQL store, we would still use those names for the key fields, so consumers of the id map data know what the field names are.

Yes, it is less than ideal that the destination is referencing the ID map directly. The destination does in some instances need to know if it's dealing with a previously-imported entity, so to remove this we would need to have some way to determine this (i.e., having MigrateExecutable figure it out and pass the information in). This is not a priority at this point, particularly with Migrate at beta-experimental stability - downgrading to normal. If someone can address this without breaking BC, patches welcome.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

heddn’s picture

Status: Active » Closed (won't fix)

Yes, we do need to decouple these things. But the current approach is good enough for D8. If/when we do fix this it will probably through an incubated contrib project. So marking this as won't fix.