CRM-15304 - DB Error on sorting Activities fields - Status, Type and Subject on Advan...
authoratif-shaikh <shaikh388@gmail.com>
Tue, 16 Sep 2014 13:07:46 +0000 (18:37 +0530)
committeratif-shaikh <shaikh388@gmail.com>
Tue, 16 Sep 2014 13:07:46 +0000 (18:37 +0530)
https://issues.civicrm.org/jira/browse/CRM-15304

CRM/Activity/BAO/Query.php
CRM/Activity/Selector/Search.php

index 0fa38fe4ab53281e281b042e4bfbbf1ff4b52f5c..e378efe51d8390975174709584c5f86c1b7514ef 100644 (file)
@@ -51,7 +51,7 @@ class CRM_Activity_BAO_Query {
     }
 
     if (!empty($query->_returnProperties['activity_type_id'])) {
-      $query->_select['activity_type_id'] = "activity_type.id as activity_type_id";
+      $query->_select['activity_type_id'] = "activity_type.value as activity_type_id";
       $query->_element['activity_type_id'] = 1;
       $query->_tables['civicrm_activity'] = 1;
       $query->_tables['activity_type'] = 1;
@@ -60,8 +60,7 @@ class CRM_Activity_BAO_Query {
     }
 
     if (!empty($query->_returnProperties['activity_type'])) {
-      $query->_select['activity_type'] = "activity_type.label as activity_type,
-        civicrm_activity.activity_type_id as activity_type_id";
+      $query->_select['activity_type'] = "activity_type.label as activity_type";
       $query->_element['activity_type'] = 1;
       $query->_tables['civicrm_activity'] = 1;
       $query->_tables['activity_type'] = 1;
@@ -91,7 +90,8 @@ class CRM_Activity_BAO_Query {
     }
 
     if (!empty($query->_returnProperties['activity_status'])) {
-      $query->_select['activity_status'] = "activity_status.label as activity_status";
+      $query->_select['activity_status'] = "activity_status.label as activity_status,
+      civicrm_activity.status_id as status_id";
       $query->_element['activity_status'] = 1;
       $query->_tables['civicrm_activity'] = 1;
       $query->_tables['activity_status'] = 1;
index 910ff505370af50e6528f5af43f54e840d092c75..0bd140e84d3dadcfcfbaa3d88652b43b2e50cb5f 100644 (file)
@@ -379,7 +379,7 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM
         ),
         array(
           'name' => ts('Subject'),
-          'sort' => 'subject',
+          'sort' => 'activity_subject',
           'direction' => CRM_Utils_Sort::DONTCARE,
         ),
         array(