Skip to content

Commit

Permalink
fix crash for radio custom fields
Browse files Browse the repository at this point in the history
  • Loading branch information
demeritcowboy committed Jun 13, 2023
1 parent f113935 commit 7abf806
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions templates/CRM/Custom/Form/Edit/CustomField.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,17 @@
<td class="label">{$formElement.label}{if $element.help_post}{help id=$element.id file="CRM/Custom/Form/CustomField.hlp" title=$element.label}{/if}</td>
<td class="html-adjust">
{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}
<br />
{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}

Expand Down

0 comments on commit 7abf806

Please sign in to comment.