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

Pipedrive - fix with import empty values #7267

Merged
Merged
Show file tree
Hide file tree
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
Expand Up @@ -101,7 +101,7 @@ public function update(array $data = [])
}

/** @var Company $company */
$company = $this->em->getRepository(Company::class)->findOneById($integrationEntity->getInternalEntityId());
$company = $this->companyModel->getEntity($integrationEntity->getInternalEntityId());

// prevent listeners from exporting
$company->setEventData('pipedrive.webhook', 1);
Expand All @@ -113,7 +113,7 @@ public function update(array $data = [])

$mappedData = $this->getMappedCompanyData($data);

$this->companyModel->setFieldValues($company, $mappedData);
$this->companyModel->setFieldValues($company, $mappedData, true);
$this->companyModel->saveEntity($company);

$integrationEntity->setLastSyncDate(new \DateTime());
Expand Down
Expand Up @@ -102,7 +102,7 @@ public function update(array $data = [])
}

/** @var Lead $lead * */
$lead = $this->em->getRepository(Lead::class)->findOneById($integrationEntity->getInternalEntityId());
$lead = $this->leadModel->getEntity($integrationEntity->getInternalEntityId());

// prevent listeners from exporting
$lead->setEventData('pipedrive.webhook', 1);
Expand All @@ -118,7 +118,7 @@ public function update(array $data = [])
} //Do not push lead if contact was modified in Mautic, and we don't wanna mofify it

$lead->setDateModified(new \DateTime());
$this->leadModel->setFieldValues($lead, $dataToUpdate);
$this->leadModel->setFieldValues($lead, $dataToUpdate, true);

if (!isset($data['owner_id']) && $lead->getOwner()) {
$lead->setOwner(null);
Expand Down