Debugging inconsistent return values from the Drupal migration_lookup plugin
I recently ran into an issue while working on a Drupal 7 to Drupal 9 migration where the migration_lookup process plugin would sometimes return an array, and sometimes return a string. This inconsistent output caused issues when the plugin is configured with multiple source migrations. To figure out a solution I had to take a deep dive into the logic of the migration_lookup plugin -- and this is what I learned.