Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix CRM-21444: use contact_type name instead of label #11523

Merged
merged 1 commit into from
Jan 16, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix CRM-21444: use contact_type name instead of label
  • Loading branch information
bjendres committed Jan 16, 2018
commit 0ad6292737025a9f5b32ad0214c2fee22cdb679a
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