X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fmigrate_plus%2Fsrc%2FPlugin%2Fmigrate%2Fprocess%2FMerge.php;h=463595e9d7b31c13bd6e7e4dc3a799d28ac1dff4;hp=1e0467917ca28f143019d56c295ec064e20d5f29;hb=059867c3f96750652c80f39e44c442a58c2549ee;hpb=f8fc16ae6b862bef59baaad5d051dd37b7ff11b2 diff --git a/web/modules/contrib/migrate_plus/src/Plugin/migrate/process/Merge.php b/web/modules/contrib/migrate_plus/src/Plugin/migrate/process/Merge.php index 1e0467917..463595e9d 100644 --- a/web/modules/contrib/migrate_plus/src/Plugin/migrate/process/Merge.php +++ b/web/modules/contrib/migrate_plus/src/Plugin/migrate/process/Merge.php @@ -41,8 +41,8 @@ use Drupal\migrate\Row; * paragraphs_field: * plugin: merge * source: - * - @temp_body - * - @temp_images + * - '@temp_body' + * - '@temp_images' * destination: * plugin: 'entity:node' */ @@ -53,12 +53,12 @@ class Merge extends ProcessPluginBase { */ 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); }