CRM-19821 performance improvement on the activity search.
[civicrm-core.git] / CRM / Activity / Selector / Search.php
index 22ec458a59d218cae831254e7b70d75b027cc1d9..4e79ea20934a943541f13ff4e68a253eeb421e6f 100644 (file)
@@ -197,9 +197,7 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM
     // type of selector
     $this->_action = $action;
     $this->_query = new CRM_Contact_BAO_Query($this->_queryParams,
-      CRM_Activity_BAO_Query::defaultReturnProperties(CRM_Contact_BAO_Query::MODE_ACTIVITY,
-        FALSE
-      ),
+      CRM_Activity_BAO_Query::selectorReturnProperties(),
       NULL, FALSE, FALSE,
       CRM_Contact_BAO_Query::MODE_ACTIVITY
     );
@@ -285,6 +283,7 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM
       if (empty($result->activity_id)) {
         continue;
       }
+      $this->_query->convertToPseudoNames($result);
 
       // the columns we are interested in
       foreach (self::$_properties as $property) {