* @return array
* @throws \CRM_Core_Exception
*/
- public static function formatGroupTree(&$groupTree, $groupCount = 1, &$form = NULL) {
+ public static function formatGroupTree($groupTree, $groupCount = 1, &$form = NULL) {
$formattedGroupTree = [];
$uploadNames = $formValues = [];
$formattedGroupTree[$key]['subtype'] = $value['subtype'] ?? NULL;
$formattedGroupTree[$key]['max_multiple'] = $value['max_multiple'] ?? NULL;
+ // Properties that might have been filtered out but which
+ // should be present to avoid smarty e-notices.
+ $expectedProperties = ['options_per_line', 'help_pre', 'help_post'];
// add field information
foreach ($value['fields'] as $k => $properties) {
+ $properties = array_merge(array_fill_keys($expectedProperties, NULL), $properties);
$properties['element_name'] = "custom_{$k}_-{$groupCount}";
if (isset($properties['customValue']) &&
!CRM_Utils_System::isNull($properties['customValue']) &&