Skip to content

EspoCRM – Open Source CRM Application

Email address field check

Yuriia8b487c3d9c9
diff --git a/application/Espo/Tools/Email/AddressService.php b/application/Espo/Tools/Email/AddressService.php
index d543be77b0..6c6267524d 100644
--- a/application/Espo/Tools/Email/AddressService.php
+++ b/application/Espo/Tools/Email/AddressService.php
@@ -76,15 +76,15 @@ class AddressService
public 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 = [];