Skip to content
Snippets Groups Projects
Commit fbc68ce6 authored by colemanw's avatar colemanw
Browse files

Merge pull request #2351 from kurund/CRM-13996

CRM-13996, fixes sorting for search views
parents abf2d852 a3c660fa
No related branches found
No related tags found
No related merge requests found
......@@ -509,6 +509,11 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
if ($rowCount) {
$cacheKey = $this->buildPrevNextCache($sort);
$result = $this->_query->getCachedContacts($cacheKey, $offset, $rowCount, $includeContactIds);
// CRM-13996: result is empty when selector columns are sorted. hence we need to run the query again
if ( $result->N == 0) {
$result = $this->_query->searchQuery($offset, $rowCount, $sort, FALSE, $includeContactIds);
}
}
else {
$result = $this->_query->searchQuery($offset, $rowCount, $sort, FALSE, $includeContactIds);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment