From 7abf806e6da51b365b4289d09b6aff8bffe2ebe2 Mon Sep 17 00:00:00 2001 From: demeritcowboy Date: Mon, 12 Jun 2023 20:57:13 -0400 Subject: [PATCH] fix crash for radio custom fields --- templates/CRM/Custom/Form/Edit/CustomField.tpl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/templates/CRM/Custom/Form/Edit/CustomField.tpl b/templates/CRM/Custom/Form/Edit/CustomField.tpl index 7a4089fb03..5a90fb207a 100644 --- a/templates/CRM/Custom/Form/Edit/CustomField.tpl +++ b/templates/CRM/Custom/Form/Edit/CustomField.tpl @@ -19,19 +19,17 @@ {$formElement.label}{if $element.help_post}{help id=$element.id file="CRM/Custom/Form/CustomField.hlp" title=$element.label}{/if} {assign var="count" value="1"} - {* sort by fails for option per line. Added a variable to iterate through the element array*} - {assign var="index" value="1"} {foreach name=outer key=key item=item from=$formElement} - {if $index < 10} - {assign var="index" value=`$index+1`} - {else} - {$formElement.$key.html} + {if is_array($item) && array_key_exists('html', $item)} + {$item.html} {if $count == $element.options_per_line}
{assign var="count" value="1"} {else} {assign var="count" value=`$count+1`} {/if} + {else} + {* Skip because this isn't one of the numeric keyed elements that are the options to display, it's non-numeric keys like the field label and metadata. *} {/if} {/foreach} -- 2.25.1