Skip to content

Commit

Permalink
fixed relation type list
Browse files Browse the repository at this point in the history
  • Loading branch information
bjendres committed May 2, 2016
1 parent 2205180 commit 6b7f2b2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CRM/Householdmerge/Logic/Scanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function __construct() {
public function findNewHouseholds($count) {
$proposals = array();

// first, find candidates (will return only one ID)
// first, find candidates
$candidates = $this->findCandidates($count);

// then go through all candidates
Expand Down Expand Up @@ -140,8 +140,8 @@ protected function findCandidates($count) {

// try joining valid, active household relationships...
$RELATIONSHIP_JOIN = "
LEFT JOIN civicrm_relationship relation_ab ON contact_id = relation_ab.contact_id_a AND relation_ab.relationship_type_id IN (8,7) AND (relation_ab.end_date IS NULL OR relation_ab.end_date > NOW())
LEFT JOIN civicrm_relationship relation_ba ON contact_id = relation_ba.contact_id_b AND relation_ba.relationship_type_id IN (8,7) AND (relation_ba.end_date IS NULL OR relation_ba.end_date > NOW())
LEFT JOIN civicrm_relationship relation_ab ON contact_id = relation_ab.contact_id_a AND relation_ab.relationship_type_id IN ($relationship_id_list) AND (relation_ab.end_date IS NULL OR relation_ab.end_date > NOW())
LEFT JOIN civicrm_relationship relation_ba ON contact_id = relation_ba.contact_id_b AND relation_ba.relationship_type_id IN ($relationship_id_list) AND (relation_ba.end_date IS NULL OR relation_ba.end_date > NOW())
";

// ...and then make sure there are none
Expand Down

0 comments on commit 6b7f2b2

Please sign in to comment.