avoid deprecated function; fix bug in buildOptions; fix display of no links
authorJon Goldberg <jon@megaphonetech.com>
Mon, 7 Jan 2019 00:08:47 +0000 (19:08 -0500)
committerJon Goldberg <jon@megaphonetech.com>
Mon, 7 Jan 2019 00:09:42 +0000 (19:09 -0500)
CRM/ACL/BAO/ACL.php
CRM/Contact/BAO/Group.php
CRM/Contact/BAO/GroupContact.php
CRM/Core/PseudoConstant.php

index 201454fc9e44da19855a585606d962d121069415..5e84ab8f4b0a177991d11907627ce56267e3bef8 100644 (file)
@@ -871,7 +871,7 @@ SELECT g.*
     }
 
     if ($allGroups == NULL) {
-      $allGroups = CRM_Core_PseudoConstant::allGroup();
+      $allGroups = CRM_Contact_BAO_Contact::buildOptions('group_id', NULL, ['onlyActive' => FALSE]);
     }
 
     $acls = CRM_ACL_BAO_Cache::build($contactID);
index 00dead650a124f2d6dcc95be7d41cd70c0168d14..031bf1513f8288ae8df2cfff775bb6c1e3ad82ca 100644 (file)
@@ -966,18 +966,20 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group {
         }
         $values[$object->id]['group_type'] = implode(', ', $types);
       }
-      $values[$object->id]['action'] = CRM_Core_Action::formLink($newLinks,
-        $action,
-        array(
-          'id' => $object->id,
-          'ssid' => $object->saved_search_id,
-        ),
-        ts('more'),
-        FALSE,
-        'group.selector.row',
-        'Group',
-        $object->id
-      );
+      if ($action) {
+        $values[$object->id]['action'] = CRM_Core_Action::formLink($newLinks,
+          $action,
+          array(
+            'id' => $object->id,
+            'ssid' => $object->saved_search_id,
+          ),
+          ts('more'),
+          FALSE,
+          'group.selector.row',
+          'Group',
+          $object->id
+        );
+      }
 
       // If group has children, add class for link to view children
       $values[$object->id]['is_parent'] = FALSE;
index 20290e2c690150f6ed2472516c773d609a568e34..9bb1dc439a5f7b794539b2f93a898a693938c801 100644 (file)
@@ -787,9 +787,8 @@ AND    contact_id IN ( $contactStr )
    * @return array|bool
    */
   public static function buildOptions($fieldName, $context = NULL, $props = array()) {
-    $params = array();
 
-    $options = CRM_Core_PseudoConstant::get(__CLASS__, $fieldName, $params, $context);
+    $options = CRM_Core_PseudoConstant::get(__CLASS__, $fieldName, $props, $context);
 
     // Sort group list by hierarchy
     // TODO: This will only work when api.entity is "group_contact". What about others?
index 076068079206d672ccc52787a09b719b37de394e..fb59a3c5f86afd8d30ff338719fff0455d9e9ca2 100644 (file)
@@ -499,7 +499,7 @@ class CRM_Core_PseudoConstant {
   }
 
   /**
-   * DEPRECATED generic populate method.
+   * @deprecated generic populate method.
    * All pseudoconstant functions that use this method are also @deprecated
    *
    * The static array $var is populated from the db