Skip to content

EspoCRM – Open Source CRM Application

fix Cannot access protected property `id` (#3506)

bfzgaier5d3201260a9f
diff --git a/application/Espo/Tools/DataPrivacy/Erasor.php b/application/Espo/Tools/DataPrivacy/Erasor.php
index a3d85e9742..72a5f28d4d 100644
--- a/application/Espo/Tools/DataPrivacy/Erasor.php
+++ b/application/Espo/Tools/DataPrivacy/Erasor.php
@@ -114,7 +114,7 @@ class Erasor implements
$this->emailAddressAccessChecker
->checkEdit($this->user, $emailAddress, $entity)
) {
- $emailAddress->set(Field::NAME, 'ERASED:' . $emailAddress->id);
+ $emailAddress->set(Field::NAME, 'ERASED:' . $emailAddress->getId());
$emailAddress->set('optOut', true);
$this->entityManager->saveEntity($emailAddress);
}
@@ -132,7 +132,7 @@ class Erasor implements
$this->phoneNumberAccessChecker
->checkEdit($this->user, $phoneNumber, $entity)
) {
- $phoneNumber->set(Field::NAME, 'ERASED:' . $phoneNumber->id);
+ $phoneNumber->set(Field::NAME, 'ERASED:' . $phoneNumber->getId());
$this->entityManager->saveEntity($phoneNumber);
}