Remove isset from add new group form
authorEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 30 Nov 2021 21:27:26 +0000 (10:27 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 30 Nov 2021 21:27:26 +0000 (10:27 +1300)
civicrm/group/add?reset=1

CRM/Group/Form/Edit.php
templates/CRM/Group/Form/GroupsCommon.tpl

index 0afebfb8108840ceb44b764a47f8ce36453ca163..6f76bdecb29a41b32ddb15bd49eb2c99e3b0d81f 100644 (file)
@@ -92,6 +92,8 @@ class CRM_Group_Form_Edit extends CRM_Core_Form {
    * Set up variables to build the form.
    */
   public function preProcess() {
+    $this->addOptionalQuickFormElement('parents');
+    $this->addExpectedSmartyVariable('parent_groups');
     $this->_id = $this->get('id');
     if ($this->_id) {
       $breadCrumb = array(
index 2be8d82ccdab14c6e2bf62d39b28c292bce9740f..0a78e42db5e5587ce9bbe48f4605d93766c94807 100644 (file)
@@ -8,9 +8,9 @@
  +--------------------------------------------------------------------+
 *}
 {*CRM-14190*}
-{if (isset($parent_groups) and $parent_groups|@count > 0) or !empty($form.parents.html)}
+{if $parent_groups|@count > 0 || !empty($form.parents.html)}
   <h3>{ts}Parent Groups{/ts} {help id="id-group-parent" file="CRM/Group/Page/Group.hlp"}</h3>
-  {if isset($parent_groups) and $parent_groups|@count > 0}
+  {if $parent_groups|@count > 0}
     <table class="form-layout-compressed">
       <tr>
         <td><label>{ts}Remove Parent?{/ts}</label></td>