$where = "WHERE {$this->_whereClause}";
}
- if (!empty($this->_permissionWhereClause)) {
+ if (!empty($this->_permissionWhereClause) && empty($this->_displayRelationshipType)) {
if (empty($where)) {
$where = "WHERE $this->_permissionWhereClause";
}
$this->_qill[0][] = $qillMessage . "'" . $relationshipTypeLabel . "'";
}
+ if (!empty($this->_permissionWhereClause)) {
+ $_rTypeWhere .= "AND $this->_permissionWhereClause";
+ }
+
if (strpos($from, $_rTypeFrom) === FALSE) {
// lets replace all the INNER JOIN's in the $from so we dont exclude other data
// this happens when we have an event_type in the quert (CRM-7969)