backport 26763
authordemeritcowboy <demeritcowboy@hotmail.com>
Fri, 7 Jul 2023 12:47:16 +0000 (08:47 -0400)
committerdemeritcowboy <demeritcowboy@hotmail.com>
Fri, 7 Jul 2023 12:47:16 +0000 (08:47 -0400)
templates/CRM/Contact/Form/Task/Batch.tpl
templates/CRM/Custom/Form/Preview.tpl
templates/CRM/Event/Form/Task/Batch.tpl
templates/CRM/Profile/Form/Dynamic.tpl
templates/CRM/UF/Form/Fields.tpl

index 2cd61d93b1a1f1df9ccae907fac67afd2491ac50..418dd56c80e180b8d5aad3f73b6ef1db6cf6ac02 100644 (file)
             <table class="form-layout-compressed">
             <tr>
             {* sort by fails for option per line. Added a variable to iterate through the element array*}
-              {assign var="index" value="1"}
               {foreach name=optionOuter key=optionKey item=optionItem from=$form.field.$cid.$n}
-                {if $index < 10}
-                  {assign var="index" value=`$index+1`}
-                {else}
+                {* There are both numeric and non-numeric keys mixed in here, where the non-numeric are metadata that aren't arrays with html members. *}
+                {if is_array($optionItem) && array_key_exists('html', $optionItem)}
                   <td class="labels font-light">{$form.field.$cid.$n.$optionKey.html}</td>
                   {if $count == $field.options_per_line}
                   </tr>
index f4481271e845b83ae3380a9652ec3788d620160a..592b916ea9c9ec4bc39704655de1f459c8dc426b 100644 (file)
                 <table class="form-layout-compressed">
                  <tr>
                    {* 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=$form.$element_name}
-                        {if $index < 10}
-                            {assign var="index" value=`$index+1`}
-                        {else}
+                     {* There are both numeric and non-numeric keys mixed in here, where the non-numeric are metadata that aren't arrays with html members. *}
+                     {if is_array($item) && array_key_exists('html', $item)}
                           <td class="labels font-light">{$form.$element_name.$key.html}</td>
                               {if $count == $element.options_per_line}
                                 {assign var="count" value="1"}
index 27760a6b08f1008318c7bb0ad62d5b7d9cd96fe6..a77ecf5f957d5452230b8e95806f4bf8ebcfdc73 100644 (file)
                       <table class="form-layout-compressed">
                       <tr>
                         {* sort by fails for option per line. Added a variable to iterate through the element array*}
-                        {assign var="index" value="1"}
                         {foreach name=optionOuter key=optionKey item=optionItem from=$form.field.$pid.$n}
-                          {if $index < 10}
-                            {assign var="index" value=`$index+1`}
-                          {else}
+                          {* There are both numeric and non-numeric keys mixed in here, where the non-numeric are metadata that aren't arrays with html members. *}
+                          {if is_array($optionItem) && array_key_exists('html', $optionItem)}
                             <td class="labels font-light">{$form.field.$pid.$n.$optionKey.html}</td>
                             {if $count == $field.options_per_line}
                             </tr>
index eb2ef70c6aa368cc89c336ae7673329c6b2da548..3fd103679594bf4e85ab9f44761db1036fa94739 100644 (file)
                 <table class="form-layout-compressed">
                 <tr>
                 {* 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=$form.$n}
-                    {if $index < 10}
-                      {assign var="index" value=`$index+1`}
-                    {else}
+                    {* There are both numeric and non-numeric keys mixed in here, where the non-numeric are metadata that aren't arrays with html members. *}
+                    {if is_array($item) && array_key_exists('html', $item)}
                       <td class="labels font-light">{$form.$n.$key.html}</td>
                       {if $count == $field.options_per_line}
                       </tr>
index b261f2dcbde6fbf4a8dfc68c75ca1471e4e51f1f..2dc383fda3e89b3ac730f50a22e4bebfb7fac112 100644 (file)
             <table class="form-layout-compressed">
               <tr>
                 {* 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}
+                  {* There are both numeric and non-numeric keys mixed in here, where the non-numeric are metadata that aren't arrays with html members. *}
+                  {if is_array($item) && array_key_exists('html', $item)}
                 <td class="labels font-light">{$formElement.$key.html}</td>
                 {if $count == $field.options_per_line}
               </tr>