Skip to content

Commit

Permalink
OS-56 - duplicating composite element in XML as combined values
Browse files Browse the repository at this point in the history
  • Loading branch information
stankut committed Jun 22, 2023
1 parent 9024f5f commit e345a2d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,15 @@ protected static function getWebformElementsAsList(WebformSubmissionInterface $w
}
}
else {
// For arrays (for example: composite elements), splitting values.
$elements_list[$field_name] = $data[$key];

// For arrays (for example: composite elements),
// values are aldo duplicated by splitting them.
if (is_array($data[$key])) {
foreach ($data[$key] as $child_key => $child_data) {
$elements_list[$field_name . "_" . $child_key] = $child_data;
}
}
else {
$elements_list[$field_name] = $data[$key];
}
}
}
}
Expand Down

0 comments on commit e345a2d

Please sign in to comment.