fix CRM-21444: use contact_type name instead of label
authorsystopia <endres@systopia.de>
Thu, 4 Jan 2018 13:39:43 +0000 (14:39 +0100)
committersystopia <endres@systopia.de>
Tue, 16 Jan 2018 07:29:03 +0000 (08:29 +0100)
CRM/Contact/Form/DedupeRules.php

index 9f032958bfe31a75d02d2525ca722f8fd17f95b7..ff12c07eb7e796b08cf819c0f1139ca9495ec768 100644 (file)
@@ -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');