I have D7 website and I'm trying to migrate it to D8. I have these modules installed:
- migrate_drupal
- migrate_drupal_ui
- migrate_drupal_multilingual
- migrate_upgrade
- migrate_tools (8.x-4.x-dev)
- migrate_plus

On 'process' page (admin/structure/migrate/manage/migrate_drupal_7/migrations/upgrade_d7_comment_type/process) the source value of 'label' is duplicated when I check d7_comment_type plugin (path: ./core/modules/comment/migrations/d7_comment_type.yml).

process page

Within the plugin the label property is configured with 'name' and 'constants/label_suffix' sources:

  label:
    plugin: concat
    source:
      - name
      - 'constants/label_suffix'
    delimiter: ' '

in Migration::__construct there is the following line:

    foreach (NestedArray::mergeDeep($plugin_definition, $configuration) as $key => $value) {

NestedArray::mergeDeep() does not preserve the integer keys. As far as I can tell, the solution is to use NestedArray::mergeDeepArray().

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rkostov created an issue. See original summary.

rkostov’s picture

rkostov’s picture

Status: Active » Needs review
heddn’s picture

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

Good find. NW for tests.

quietone’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
FileSize
2.49 KB
3.19 KB

Adding a test

The last submitted patch, 5: 3012001-5-fail.patch, failed testing. View results

quietone’s picture

The fail patch failed as intended. This is ready for review/

heddn’s picture

Status: Needs review » Reviewed & tested by the community

Good, we have tests for a fairly obvious bug.

larowlan’s picture

Version: 8.6.2 » 8.8.x-dev
quietone’s picture

Just noting that this fixes a problem where I was getting duplicates in the id array and the fields array of CSV source files.

ellenoise’s picture

Chiming in to add: Patch #5 works for me, and resolves a duplicate id error in a CSV source migration.

catch’s picture

Version: 8.8.x-dev » 8.7.x-dev
Status: Reviewed & tested by the community » Fixed

Committed ddfcac8 and pushed to 8.8.x. Thanks!
(and cherry-picked to 8.7.x).

  • catch committed ddfcac8 on 8.8.x
    Issue #3012001 by quietone, rkostov, ellenoise: Duplications within...

  • catch committed 4cbcc93 on 8.7.x
    Issue #3012001 by quietone, rkostov, ellenoise: Duplications within...
catch’s picture

Status: Fixed » Closed (fixed)

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