Skip to content

Commit

Permalink
Towards CRM-20328 remove another call to the duplicate code
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Mar 28, 2017
1 parent 7dfe13a commit 6bdf1df
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions CRM/Event/Form/Registration/Register.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,7 @@ protected static function getRegistrationContactID($fields, $self, $isAdditional
$contactID = $self->getContactID();
}
if (!$contactID && is_array($fields) && $fields) {

//CRM-14134 use Unsupervised rule for everyone
$dedupeParams = CRM_Dedupe_Finder::formatParams($fields, 'Individual');

// disable permission based on cache since event registration is public page/feature.
$dedupeParams['check_permission'] = FALSE;

// find event dedupe rule
if (CRM_Utils_Array::value('dedupe_rule_group_id', $self->_values['event'], 0) > 0) {
$ids = CRM_Dedupe_Finder::dupesByParams($dedupeParams, 'Individual', 'Unsupervised', array(), $self->_values['event']['dedupe_rule_group_id']);
}
else {
$ids = CRM_Dedupe_Finder::dupesByParams($dedupeParams, 'Individual', 'Unsupervised');
}
$contactID = CRM_Utils_Array::value(0, $ids);
$contactID = CRM_Contact_BAO_Contact::getFirstDuplicateContact($fields, 'Individual', 'Unsupervised', array(), FALSE, CRM_Utils_Array::value('dedupe_rule_group_id', $self->_values['event']));
}
return $contactID;
}
Expand Down

0 comments on commit 6bdf1df

Please sign in to comment.