Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.1.1
-
Fix Version/s: 4.2.0
-
Component/s: Core CiviCRM
-
Labels:None
Description
The problem happens if you do an advanced search, expand the activities section, and search on one or more activity types.
The pager reports over 360,000 results (on a database with 13,000 contacts). Also, it only displays 3 results on the first screen, despite having 50 as the number of results to display per page. I'm expecting one result per contact with an activity of the types I specified and 50 results per page.
I've tracked the problem down to the code in Contact/BAO/Query.php.
The query function seems to set $this->_useDistinct = false if $this->_distinctComponentClause is not set.
As a result, the search does not use DISTINCT and we get duplicate contacts because a contact could be coded to more than one activity of a given activity type.
I'm not sure how to fix it.