Field values are not removed if the migration destination contains a slash

Created on 2 February 2020, almost 5 years ago
Updated 3 September 2024, 4 months ago

Problem/Motivation

MigrateExecutable::processRow calls setEmptyDestinationProperty which just does $this->emptyDestinationProperties[] = $property;. And then EntityContentBase::updateEntity iterates this expecting the values to be field names:

    foreach ($empty_destinations as $field_name) {
      $entity->$field_name = NULL;
    }

but what if someone used somefieldname/property as destination? It totes works for setting things. It just doesn't when removing things.

Proposed resolution

I guess Row needs to do the processing in a new method / class property.

Remaining tasks

Agree on naming and such, write patch and test.

User interface changes

API changes

I would expect a new method.

Data model changes

Release notes snippet

πŸ› Bug report
Status

Needs review

Version

11.0 πŸ”₯

Component
MigrationΒ  β†’

Last updated about 12 hours ago

Created by

πŸ‡¨πŸ‡¦Canada Charlie ChX Negyesi 🍁Canada

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • Merge request !9400Draft: Empty field properties β†’ (Open) created by prudloff
  • Status changed to Needs review 4 months ago
  • πŸ‡«πŸ‡·France prudloff Lille

    I fixed it entirely in EntityContentBase::updateEntity() but it might be cleaner to make Row::$emptyDestinationProperties a nested array and move the splitting logic to Row::setEmptyDestinationProperty().

  • Pipeline finished with Failed
    4 months ago
    Total: 213s
    #272595
  • Pipeline finished with Failed
    4 months ago
    Total: 636s
    #272604
  • πŸ‡ΊπŸ‡ΈUnited States benjifisher Boston area

    @prudloff:

    You marked this issue as NR, but you marked MR 9400 as Draft. Please clarify the status.

    I made a formatting suggestion on the MR, but I have not looked into the code yet.

  • πŸ‡ΊπŸ‡ΈUnited States benjifisher Boston area

    There are some failing tests on the MR, but they do not seem related to this issue.

  • πŸ‡«πŸ‡·France prudloff Lille

    I marked it as a draft because of this comment:

    it might be cleaner to make Row::$emptyDestinationProperties a nested array and move the splitting logic to Row::setEmptyDestinationProperty()

  • Pipeline finished with Success
    3 months ago
    Total: 495s
    #297847
  • The Needs Review Queue Bot β†’ tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide β†’ to find step-by-step guides for working with issues.

Production build 0.71.5 2024