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 the API bug that cause Outlook plugin fail to sync #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
12 changes: 6 additions & 6 deletions api/v3/CiviOutlook.php
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ function civicrm_api3_civi_outlook_getgroupcontacts($params) {
}

//get Outlook and CiviCRM field mapping for additional contact details
$mappings = civicrm_api3_civi_outlook_getadditionalfieldmapping();
$mappings = civicrm_api3_civi_outlook_getadditionalfieldmapping([]);

//send only the essential/required contact details
if (!empty($groupData)) {
Expand Down Expand Up @@ -842,7 +842,7 @@ function civicrm_api3_civi_outlook_getgroupcontacts($params) {
'id' => $customDataDetails['id'],
));
if (!empty($resultCustomField['values'][0])) {
$customData[$resultCustomField['values'][0]['name']] = $customDataDetails['latest'];
$customData['civi_custom_field_' . $resultCustomField['values'][0]['name']] = $customDataDetails['latest'];

$multipleOptionValues = array();
//if option group/value are used in the custom fields, get option_value label
Expand All @@ -866,7 +866,7 @@ function civicrm_api3_civi_outlook_getgroupcontacts($params) {
}
}
//comma separated custom field values
$customData[$resultCustomField['values'][0]['name']] = implode(", ", $multipleValues);
$customData['civi_custom_field_' . $resultCustomField['values'][0]['name']] = implode(", ", $multipleValues);
}
}
}
Expand Down Expand Up @@ -917,7 +917,7 @@ function civicrm_api3_civi_outlook_getgroupcontacts($params) {
$temp[$groupID][$key]['phone_1_3'] = $additionalPhoneNumbers[$mappings['values']['HomeFaxNumber']][3];
// Multiple work phone to be added to Business2TelephoneNumber

CRM_Core_Error::debug_var('additionalPhoneNumbers', $additionalPhoneNumbers);
//CRM_Core_Error::debug_var('additionalPhoneNumbers', $additionalPhoneNumbers);
//business telephone number
$temp[$groupID][$key]['phone_2_1'] = $additionalPhoneNumbers[$mappings['values']['BusinessTelephoneNumber']][1];
$temp[$groupID][$key]['phone_2_2'] = $additionalPhoneNumbers[$mappings['values']['Business2TelephoneNumber']][2];
Expand Down Expand Up @@ -969,9 +969,9 @@ function civicrm_api3_civi_outlook_getgroupcontacts($params) {
}

//build final result and return to Outlook
$result['values'] = call_user_func_array('array_merge', $temp);
$result = call_user_func_array('array_merge', $temp);

return $result;
return civicrm_api3_create_success($result, $params, 'CiviOutlook', 'getgroupcontacts');
}


Expand Down