🐛 fix bug: cannot search for TwingleForm by twingle_project_id
This commit is contained in:
parent
6476a163fc
commit
51b19ac68d
2 changed files with 21 additions and 0 deletions
|
@ -14,6 +14,13 @@ use CRM_TwingleCampaign_Utils_ExtensionCache as Cache;
|
||||||
function _civicrm_api3_twingle_form_Get_spec(array &$spec) {
|
function _civicrm_api3_twingle_form_Get_spec(array &$spec) {
|
||||||
$spec['id'] = [
|
$spec['id'] = [
|
||||||
'name' => 'id',
|
'name' => 'id',
|
||||||
|
'title' => E::ts('Campaign ID'),
|
||||||
|
'type' => CRM_Utils_Type::T_INT,
|
||||||
|
'api.required' => 0,
|
||||||
|
'description' => E::ts('The campaign ID'),
|
||||||
|
];
|
||||||
|
$spec['twingle_project_id'] = [
|
||||||
|
'name' => 'twingle_project_id',
|
||||||
'title' => E::ts('TwingleProject ID'),
|
'title' => E::ts('TwingleProject ID'),
|
||||||
'type' => CRM_Utils_Type::T_INT,
|
'type' => CRM_Utils_Type::T_INT,
|
||||||
'api.required' => 0,
|
'api.required' => 0,
|
||||||
|
@ -66,6 +73,13 @@ function civicrm_api3_twingle_form_Get(array $params): array {
|
||||||
// Get custom fields
|
// Get custom fields
|
||||||
$custom_field_mapping = Cache::getInstance()->getCustomFieldMapping();
|
$custom_field_mapping = Cache::getInstance()->getCustomFieldMapping();
|
||||||
|
|
||||||
|
// Replace twingle_project_id key with custom field name
|
||||||
|
if (key_exists('twingle_project_id', $params)) {
|
||||||
|
$params[$custom_field_mapping['twingle_project_id']] =
|
||||||
|
$params['twingle_project_id'];
|
||||||
|
unset($params['twingle_project_id']);
|
||||||
|
}
|
||||||
|
|
||||||
// Replace twingle_project_type key with custom field name
|
// Replace twingle_project_type key with custom field name
|
||||||
if (key_exists('twingle_project_type', $params)) {
|
if (key_exists('twingle_project_type', $params)) {
|
||||||
$params[$custom_field_mapping['twingle_project_type']] =
|
$params[$custom_field_mapping['twingle_project_type']] =
|
||||||
|
|
|
@ -12,6 +12,13 @@ use CRM_TwingleCampaign_ExtensionUtil as E;
|
||||||
function _civicrm_api3_twingle_form_Getsingle_spec(array &$spec) {
|
function _civicrm_api3_twingle_form_Getsingle_spec(array &$spec) {
|
||||||
$spec['id'] = [
|
$spec['id'] = [
|
||||||
'name' => 'id',
|
'name' => 'id',
|
||||||
|
'title' => E::ts('Campaign ID'),
|
||||||
|
'type' => CRM_Utils_Type::T_INT,
|
||||||
|
'api.required' => 0,
|
||||||
|
'description' => E::ts('The campaign ID'),
|
||||||
|
];
|
||||||
|
$spec['twingle_project_id'] = [
|
||||||
|
'name' => 'twingle_project_id',
|
||||||
'title' => E::ts('TwingleProject ID'),
|
'title' => E::ts('TwingleProject ID'),
|
||||||
'type' => CRM_Utils_Type::T_INT,
|
'type' => CRM_Utils_Type::T_INT,
|
||||||
'api.required' => 0,
|
'api.required' => 0,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue