Template notice cleanup - make sane
authorEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 26 Nov 2021 01:40:03 +0000 (14:40 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Sat, 27 Nov 2021 20:34:17 +0000 (09:34 +1300)
The CRM/Custom/Form/CustomData.tpl is called with formEdit set from
1 place - CRM/Contact/Form/Edit/CustomData.tpl - when this is the
case only 1 line of code is shared with the code path if
formEdit is not true/ passed in. This is silly & can be avoided

templates/CRM/Contact/Form/Edit/CustomData.tpl
templates/CRM/Custom/Form/CustomData.tpl

index 7c8beed8ebccdb9fae9de9faebc712d6d132858a..98c49144d49ff5db8217837d769749ba5f6e191a 100644 (file)
@@ -23,7 +23,8 @@
       {$cd_edit.title}
     </div>
     <div id="customData{$group_id}" class="crm-accordion-body">
-      {include file="CRM/Custom/Form/CustomData.tpl" formEdit=true}
+      {include file="CRM/Custom/Form/Edit/CustomData.tpl" customDataEntity=''}
+      {include file="CRM/Form/attachmentjs.tpl"}
     </div>
     <!-- crm-accordion-body-->
   </div>
index 1b1cb103e7413b8a4a9e77f734a5c8ef1dbf98a5..9a89e00fe8f0482c4ed079455ead6b840914f841 100644 (file)
@@ -8,10 +8,7 @@
  +--------------------------------------------------------------------+
 *}
 {* Custom Data form*}
-{if !empty($formEdit)}
-  {include file="CRM/Custom/Form/Edit/CustomData.tpl" customDataEntity=''}
-{else}
-  {foreach from=$groupTree item=cd_edit key=group_id name=custom_sets}
+{foreach from=$groupTree item=cd_edit key=group_id name=custom_sets}
     {if $cd_edit.is_multiple and $multiRecordDisplay eq 'single'}
       {assign var="isSingleRecordEdit" value=TRUE}
     {else}
@@ -41,6 +38,4 @@
     {/if}
   {/foreach}
 
-{/if}
-
 {include file="CRM/Form/attachmentjs.tpl"}