I am migrating content from Drupal 7 to Drupal 8. There is an audio field that I am currently moving to media via a custom process during migration.
When I get the id of the new media created I can't seem to get it to attach to my new media reference field in the also newly created node.
Can anyone tell me what is wrong with the import below?
field_audio_fileinfo:
-
plugin: sub_process
source: field_audio_fileinfo
process:
target_id:
-
plugin: migration_lookup
method: process
source: fid
migration: upgrade_d7_file
-
plugin: my_custom_process
destination: field_media_audio
In my custom process I can save the media and get it's ID via:
$media_id = $audio_media->id();
$arr[] = array(
'target_id' => $media_id,
'display' => NULL,
'description' => NULL
);
return $arr;
But it doesn't seem to populate the destination field.
This is also the case if I just return the ID directly from the process.