diff --git a/CRM/Contact/Form/DedupeRules.php b/CRM/Contact/Form/DedupeRules.php index 9f032958bfe3..ff12c07eb7e7 100644 --- a/CRM/Contact/Form/DedupeRules.php +++ b/CRM/Contact/Form/DedupeRules.php @@ -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');