EspoCRM – Open Source CRM Application
PHP calendarcontactscrmcrm-platformcrm-systemcustomer-portalcustomer-supportcustomizabledocumentsemail-marketingkanbanleadsopen-sourcephpplatformsales-automationsingle-page-applicationsupport
Email address field check
Yuriia8b487c3d9c9
diff --git a/application/Espo/Tools/Email/AddressService.php b/application/Espo/Tools/Email/AddressService.phpindex d543be77b0..6c6267524d 100644--- a/application/Espo/Tools/Email/AddressService.php+++ b/application/Espo/Tools/Email/AddressService.php@@ -76,15 +76,15 @@ class AddressServicepublic function searchInEntityType(string $entityType, string $query, int $limit): array{if (!in_array($entityType, $this->getHavingEmailAddressEntityTypeList())) {- throw new NotFound("No 'email' field.");+ throw new NotFound("Entity type without Email Address field.");}if (!$this->acl->checkScope($entityType, Acl\Table::ACTION_READ)) {throw new Forbidden("No access to $entityType.");}- if (!$this->acl->checkField($entityType, 'email')) {- throw new Forbidden("No access to field 'email' in $entityType.");+ if (!$this->acl->checkField($entityType, Field::EMAIL_ADDRESS)) {+ throw new Forbidden("No access to field 'emailAddress' in $entityType.");}$result = [];