Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.3.3, 4.3.5
-
Fix Version/s: 4.7
-
Component/s: CiviReport
-
Labels:
-
Documentation Required?:None
-
Funding Source:Core Team Funds
Description
When you extract a report filtered with a specific relation type and a specific group, the report fails no matching contacts.
I debug this issue and I think that the problem is that the function "whereGroupClause" from the file "CRM/Report/Form.php" is not enough for a relationship report because it don't check if the contact comes from a "b_a" relationship.
I don't know if this is a correct solution, but I patched this issue adding the same "whereGroupClause" function in the file "CRM/Report/Form/Contact/Relationship.php" only modifying the following lines:
+if ($this->relationType == 'a_b') $relationship_contact=$this->_aliases['civicrm_contact']; + else $relationship_contact=$this->_aliases['civicrm_contact_b']; + return " {$relationship_contact}.id {$sqlOp} ( - return " {$this->_aliases['civicrm_contact']}.id {$sqlOp} (