Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Migrated field instances 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 instance migration destination plugin.
Remaining tasks
Add a rollback()
function to the EntityFieldInstance
class.
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#4 | field_instance_rollback_fails-2706951-4-complete.patch | 3.58 KB | jofitz |
#4 | field_instance_rollback_fails-2706951-4-tests.patch | 2.93 KB | jofitz |
Comments
Comment #2
jofitz CreditAttribution: jofitz at ComputerMinds commentedAdd a
rollback()
function to theEntityFieldInstance
class.Comment #3
mikeryanLet'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', 'article', 'field_foo')) rather than using the ID as it's understood by the entity system ('node.article.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).
Comment #4
jofitz CreditAttribution: jofitz at ComputerMinds commentedAdd a test to demonstrate the failure.
Comment #7
mikeryanTested locally on 8.2.x, works fine, patch looks good!
Comment #8
alexpottCommitted and pushed 7f5305b to 8.3.x and f73729a to 8.2.x and 08aceee to 8.1.x. Thanks!