From 0ad6292737025a9f5b32ad0214c2fee22cdb679a Mon Sep 17 00:00:00 2001 From: systopia Date: Thu, 4 Jan 2018 14:39:43 +0100 Subject: [PATCH] fix CRM-21444: use contact_type name instead of label --- CRM/Contact/Form/DedupeRules.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/Form/DedupeRules.php b/CRM/Contact/Form/DedupeRules.php index 9f032958bf..ff12c07eb7 100644 --- a/CRM/Contact/Form/DedupeRules.php +++ b/CRM/Contact/Form/DedupeRules.php @@ -58,10 +58,12 @@ class CRM_Contact_Form_DedupeRules extends CRM_Admin_Form { } $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'); -- 2.25.1