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 Sugar/Suite CRM sync for email addresses with an uppercase char #7401

Merged
merged 4 commits into from May 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions plugins/MauticCrmBundle/Integration/SugarcrmIntegration.php
Expand Up @@ -1449,7 +1449,9 @@ private function fetchDncToMautic(Lead $lead, array $data)
* @param $leadSugarFields
* @param string $object
*
* @return mixed
* @return array The first element is made up of records that exist in Mautic, but which no longer have a match in CRM.
* We therefore assume that they've been deleted in CRM and will mark them as deleted in the pushLeads function (~line 1320).
* The second element contains Ids of records that were explicitly marked as deleted in CRM. ATM, nothing is done with this data.
*/
public function getObjectDataToUpdate($checkEmailsInSugar, &$mauticData, $availableFields, $contactSugarFields, $leadSugarFields, $object = 'Leads')
{
Expand Down Expand Up @@ -1497,7 +1499,7 @@ public function getObjectDataToUpdate($checkEmailsInSugar, &$mauticData, $availa
$key = mb_strtolower($email);
$leadOwnerEmails = [];
foreach ($checkEmailsInSugar as $emailKey => $mauticRecord) {
if ($email == $emailKey) {
if ($key == $emailKey) {
$isConverted = (isset($sugarLeadRecord['contact_id'])
&& $sugarLeadRecord['contact_id'] != null
&& $sugarLeadRecord['contact_id'] != '');
Expand Down