Skip to content

Commit

Permalink
fix CRM-21444: use contact_type name instead of label
Browse files Browse the repository at this point in the history
  • Loading branch information
bjendres committed Jan 16, 2018
1 parent 6afa43d commit 0ad6292
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CRM/Contact/Form/DedupeRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ public function preProcess() {
}
$this->_options = CRM_Core_SelectValues::getDedupeRuleTypes();
$this->_rgid = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, 0);

// check if $contactType is valid
$contactTypes = civicrm_api3('Contact', 'getOptions', array('field' => "contact_type", 'context' => "validate"));
$contactType = CRM_Utils_Request::retrieve('contact_type', 'String', $this, FALSE, 0);
if (CRM_Utils_Array::value($contactType, $contactTypes['values'])) {
$this->_contactType = CRM_Utils_Array::value($contactType, $contactTypes['values']);
$this->_contactType = $contactType;
}
elseif (!empty($contactType)) {
throw new CRM_Core_Exception('Contact Type is Not valid');
Expand Down

0 comments on commit 0ad6292

Please sign in to comment.