Problem/Motivation

Migrated fields are not removed when the migration is rolled back.

Proposed resolution

The rollback() function of the Entity class cannot handle the multi-field $destination_identifier provided by the field migration destination plugin.

Remaining tasks

Add a rollback() function to the EntityFieldStorageConfig class.

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jo Fitzgerald created an issue. See original summary.

jofitz’s picture

Issue summary: View changes
jofitz’s picture

Add a rollback() function to the EntityFieldStorageConfig class.

mikeryan’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Let's have a test-only patch demonstrating the failure.

Looking more carefully, I'm not sure why we're using a multi-column destination key here in the first place (array('node', 'field_foo')) rather than using the ID as it's understood by the entity system ('node.field_foo'). I.e., couldn't we implement getEntityId() like EntityBaseFieldOverride does, instead of getIds()? EntityConfigBase::import() would need some adjustment, but ultimately I think the whole thing will be simpler (including not having overridden rollback() implementations).

jofitz’s picture

The last submitted patch, 5: field_migration_rollback_fails-2706947-5-tests.patch, failed testing.

The last submitted patch, 5: field_migration_rollback_fails-2706947-5-tests.patch, failed testing.

mikeryan’s picture

Status: Needs review » Reviewed & tested by the community

Tested locally on 8.2.x, works fine, patch looks good!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed 65898a5 to 8.3.x and 1c4857d to 8.2.x and 6a1e3fd to 8.1.x. Thanks!

  • alexpott committed 65898a5 on 8.3.x
    Issue #2706947 by Jo Fitzgerald: Field migration rollback fails
    

  • alexpott committed 1c4857d on 8.2.x
    Issue #2706947 by Jo Fitzgerald: Field migration rollback fails
    
    (cherry...

  • alexpott committed 6a1e3fd on 8.1.x
    Issue #2706947 by Jo Fitzgerald: Field migration rollback fails
    
    (cherry...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.