* paragraphs_field:
* plugin: merge
* source:
- * - @temp_body
- * - @temp_images
+ * - '@temp_body'
+ * - '@temp_images'
* destination:
* plugin: 'entity:node'
*/
*/
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
if (!is_array($value)) {
- throw new MigrateException('Input should be an array.');
+ throw new MigrateException(sprintf('Merge process failed for destination property (%s): input is not an array.', $destination_property));
}
$new_value = [];
- foreach ($value as $item) {
+ foreach($value as $i => $item) {
if (!is_array($item)) {
- throw new MigrateException('One of the items is not an array that can be merged.');
+ throw new MigrateException(sprintf('Merge process failed for destination property (%s): index (%s) in the source value is not an array that can be merged.', $destination_property, $i));
}
$new_value = array_merge($new_value, $item);
}