diff --git a/templates/CRM/Custom/Form/Edit/CustomField.tpl b/templates/CRM/Custom/Form/Edit/CustomField.tpl
index 7a4089fb035b..5a90fb207a6d 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}
|