Remove notice-causing do-nothing script
authorEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 28 Oct 2022 00:02:31 +0000 (13:02 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 28 Oct 2022 00:16:12 +0000 (13:16 +1300)
In my UI testing & code delving I couldn't see how hiding 'extends_1' was
doing anything. The field didn't seem to be on the page
and the 'extends' files were not hidden....

CRM/Custom/Form/Group.php
templates/CRM/Custom/Form/Group.tpl

index 46dde5f9b2182aa065f8f82bf8be4ec08851f807..be0ac00fdd6120b25a284442513175af72e34888 100644 (file)
@@ -181,15 +181,6 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
       }
     }
 
-    if (!isset($this->_id)) {
-      $formName = 'document.forms.' . $this->_name;
-
-      $js = "<script type='text/javascript'>\n";
-      $js .= "{$formName}['extends_1'].style.display = 'none';\n";
-      $js .= "</script>";
-      $this->assign('initHideBlocks', $js);
-    }
-
     $sel = &$this->add('hierselect',
       'extends',
       ts('Used For'),
index d97e4df47813fdebc9eb4733470670f5e92daa39..da3d1178ebd8a2ac341613c6bc990fc71d4757c4 100644 (file)
@@ -73,7 +73,7 @@
       {crmButton p='civicrm/admin/custom/group/field' q="action=browse&reset=1&gid=$gid" icon="th-list"}{ts}Custom Fields for this Set{/ts}{/crmButton}
     </div>
 {/if}
-{if !empty($initHideBlocks|smarty:nodefaults)}{$initHideBoxes|smarty:nodefaults}{/if}
+
 {literal}
 <script type="text/Javascript">
 CRM.$(function($) {
@@ -102,7 +102,7 @@ CRM.$(function($) {
   function showHideStyle() {
     var
       extend = $(this).val(),
-      contactTypes = {/literal}{$contactTypes}{literal},
+      contactTypes = {/literal}{$contactTypes|smarty:nodefaults}{literal},
       showStyle = "{/literal}{$showStyle}{literal}",
       showMultiple = "{/literal}{$showMultiple}{literal}",
       showMaxMultiple = "{/literal}{$showMaxMultiple}{literal}",