Aggregate heterogeneous media fields for structured Drupal migration
Issue:
You want to combine multiple image fields from a legacy system into a single media field in a new Drupal system during migration.
Solution:
The code uses the migration API of Drupal to merge multiple source image fields into a single media field. It employs the merge plugin to combine the fields and a sub-process to transform the references into media entities using a migration lookup.