Skip to content
Snippets Groups Projects
Commit e212e3c9 authored by Peter Droogmans's avatar Peter Droogmans Committed by Peter Droogmans
Browse files

Issue #3202814 by attiks: Allow array of strings to be mapped

parent 60341c17
No related branches found
No related tags found
No related merge requests found
......@@ -307,8 +307,15 @@ class ExternalEntityStorage extends ContentEntityStorageBase implements External
if (!empty($raw_data[$exploded_mapped_key[0]]) && isset($exploded_mapped_key[1]) && $exploded_mapped_key[1] === '*') {
$parents = array_slice($exploded_mapped_key, 2);
foreach (array_values($raw_data[$exploded_mapped_key[0]]) as $key => $value) {
$is_an_array = is_array($value);
$value = !is_array($value) ? [$value] : $value;
$field_values[$key][$property_name] = NestedArray::getValue($value, $parents);
if ($is_an_array) {
$field_values[$key][$property_name] = NestedArray::getValue($value, $parents);
}
else {
$field_values[$key][$property_name] = reset(NestedArray::getValue($value, $parents));
}
}
}
else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment