Commit ed835203 authored by ErikHommel's avatar ErikHommel
Browse files

fix issue 4516

parent 8269ccf4
......@@ -48,6 +48,23 @@ class CRM_Acqconfigitems_CustomField {
if (!isset($this->_apiParams['column_name'])) {
$this->_apiParams['column_name'] = $this->_apiParams['name'];
}
// check if filter is set and if required, change group name into id
if (isset($this->_apiParams['filter']) && !empty($this->_apiParams['filter'])) {
$parts = explode('&group=', $this->_apiParams['filter']);
if (isset($parts[1])) {
try {
$groupId = civicrm_api3('Group', 'getvalue', [
'return' => 'id',
'name' => $parts[1],
]);
if ($groupId) {
$this->_apiParams['filter'] = str_replace($parts[1], $groupId, $this->_apiParams['filter']);
}
}
catch (CiviCRM_API3_Exception $ex) {
}
}
}
}
/**
......
......@@ -73,6 +73,7 @@
"label": "Accountmanager",
"data_type": "ContactReference",
"html_type": "Autocomplete-Select",
"filter": "action=lookup&group=acq_account_managers",
"is_searchable": 1,
"is_active": 1,
"is_required": 0,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment