ParagraphsSubProcess plugin does not merge paragraph items when using += operator

Created on 20 June 2025, 5 days ago

Problem/Motivation

When using ParagraphsSubProcess for multiple sources, the transform() method accumulates results using the + operator. This causes data loss when multiple paragraph items have the same numeric keys since + preserves the left-hand array's keys and ignores duplicates from the right-hand side.

As a result, only a subset of the paragraphs are migrated when merging results from multiple sources.

Steps to reproduce

Example:

  field_paragraphs:
    plugin: paragraphs_sub_process
    source: field_paragraphs
    migration:
      - paragraph_media_text
      - paragraph_text
      - paragraph_teaser
    process:
      target_id: '0'
      target_revision_id: '1'

Proposed resolution

Replace the + operator with array_merge() to ensure all items are appended properly regardless of numeric keys:

Remaining tasks

Review & test

User interface changes

N/A

API changes

N/A

Data model changes

N/A

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇧🇪Belgium baikho Antwerp, BE

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024