}
// note : this modifies _fromClause and _simpleFromClause
+ $this->_sort = $sort;
$this->includePseudoFieldsJoin($sort);
list($select, $from, $where, $having) = $this->query($count, $sortByChar, $groupContacts, $onlyDeleted);
if (!$count) {
$this->_useDistinct = TRUE;
}
-
- if (empty($this->_fromClause)) {
- $this->_fromClause = self::fromClause($this->_tables, NULL, NULL, $this->_primaryLocation, $this->_mode);
- }
-
- if (empty($this->_simpleFromClause)) {
- $this->_simpleFromClause = self::fromClause($this->_whereTables, NULL, NULL, $this->_primaryLocation, $this->_mode);
+ //CRM-15231
+ $this->_fromClause = self::fromClause($this->_tables, NULL, NULL, $this->_primaryLocation, $this->_mode);
+ $this->_simpleFromClause = self::fromClause($this->_whereTables, NULL, NULL, $this->_primaryLocation, $this->_mode);
+ if (!empty($_GET['crmSID'])) {
+ $this->includePseudoFieldsJoin($this->_sort);
}
}
}