Commit f95e6b75 authored by joachim's avatar joachim Committed by heddn

Issue #2971382 by joachim, heddn: Merge process plugin should say which of its...

Issue #2971382 by joachim, heddn: Merge process plugin should say which of its sources was not valid
parent 28a69ab3
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment