Skip to content

Commit

Permalink
Merge pull request #13535 from civicrm/5.10
Browse files Browse the repository at this point in the history
5.10 to master
  • Loading branch information
eileenmcnaughton authored Feb 5, 2019
2 parents 2099e28 + bcc1969 commit e0c7f47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CRM/Contact/BAO/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -4904,7 +4904,7 @@ public function searchQuery(
// MySQL expect the columns present in GROUP BY, must be present in SELECT clause and that results into error, needless to have other columns.
// 2. When GROUP BY columns are present then disable FGB otherwise it demands to add ORDER BY columns in GROUP BY and eventually in SELECT
// clause. This will impact the search query output.
$disableFullGroupByMode = ($sortByChar || !empty($groupByCols));
$disableFullGroupByMode = ($sortByChar || !empty($groupByCols) || $groupContacts);

if ($disableFullGroupByMode) {
CRM_Core_DAO::disableFullGroupByMode();
Expand Down Expand Up @@ -4984,7 +4984,7 @@ public function getCachedContacts($cids, $includeContactIds) {
$select .= sprintf(", (%s) AS _wgt", $this->createSqlCase('contact_a.id', $cids));
$where .= sprintf(' AND contact_a.id IN (%s)', implode(',', $cids));
$order = 'ORDER BY _wgt';
$groupBy = '';
$groupBy = $this->_useGroupBy ? ' GROUP BY contact_a.id' : '';
$limit = '';
$query = "$select $from $where $groupBy $order $limit";

Expand Down
2 changes: 1 addition & 1 deletion CRM/Contact/Selector.php
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ public function fillupPrevNextCache($sort, $cacheKey, $start = 0, $end = self::C

$selectSQL = "SELECT DISTINCT '$cacheKey', contact_a.id, contact_a.sort_name";

$sql = str_replace(array("SELECT contact_a.id as contact_id", "SELECT contact_a.id as id"), $selectSQL, $sql);
$sql = str_ireplace(array("SELECT contact_a.id as contact_id", "SELECT contact_a.id as id"), $selectSQL, $sql);
try {
Civi::service('prevnext')->fillWithSql($cacheKey, $sql);
}
Expand Down

0 comments on commit e0c7f47

Please sign in to comment.