EspoCRM – Open Source CRM Application
PHP calendarcontactscrmcrm-platformcrm-systemcustomer-portalcustomer-supportcustomizabledocumentsemail-marketingkanbanleadsopen-sourcephpplatformsales-automationsingle-page-applicationsupport
Fix email/phone saver
Yurii74c0dcf30084
diff --git a/application/Espo/Core/FieldProcessing/EmailAddress/Saver.php b/application/Espo/Core/FieldProcessing/EmailAddress/Saver.phpindex eaba3b5de8..33cae4b1ef 100644--- a/application/Espo/Core/FieldProcessing/EmailAddress/Saver.php+++ b/application/Espo/Core/FieldProcessing/EmailAddress/Saver.php@@ -591,8 +591,6 @@ class Saver implements SaverInterfacereturn;}- $one->set(EmailAddress::FIELD_PRIMARY, true);-- $this->entityManager->saveEntity($one);+ $relation->updateColumns($one, ['primary' => true]);}}diff --git a/application/Espo/Core/FieldProcessing/PhoneNumber/Saver.php b/application/Espo/Core/FieldProcessing/PhoneNumber/Saver.phpindex 0a197b509b..6f91d6eaeb 100644--- a/application/Espo/Core/FieldProcessing/PhoneNumber/Saver.php+++ b/application/Espo/Core/FieldProcessing/PhoneNumber/Saver.php@@ -32,7 +32,6 @@ namespace Espo\Core\FieldProcessing\PhoneNumber;use Espo\Core\FieldProcessing\Loader\Params as LoeaderParams;use Espo\Core\ORM\Repository\Option\SaveOption;use Espo\Core\ORM\Type\FieldType;-use Espo\Entities\EmailAddress;use Espo\Entities\PhoneNumber;use Espo\ORM\Name\Attribute;use Espo\ORM\Repository\RDBRelation;@@ -603,8 +602,6 @@ class Saver implements SaverInterfacereturn;}- $one->set(EmailAddress::FIELD_PRIMARY, true);-- $this->entityManager->saveEntity($one);+ $relation->updateColumns($one, ['primary' => true]);}}diff --git a/application/Espo/Entities/EmailAddress.php b/application/Espo/Entities/EmailAddress.phpindex 682231fd38..940668e952 100644--- a/application/Espo/Entities/EmailAddress.php+++ b/application/Espo/Entities/EmailAddress.php@@ -40,8 +40,6 @@ class EmailAddress extends Entitypublic const RELATION_ENTITY_EMAIL_ADDRESS = 'EntityEmailAddress';- public const string FIELD_PRIMARY = 'primary';-/*** @param string $value* @return voiddiff --git a/application/Espo/Entities/PhoneNumber.php b/application/Espo/Entities/PhoneNumber.phpindex e8b355d92f..9c1855d2c9 100644--- a/application/Espo/Entities/PhoneNumber.php+++ b/application/Espo/Entities/PhoneNumber.php@@ -40,8 +40,6 @@ class PhoneNumber extends Entitypublic const RELATION_ENTITY_PHONE_NUMBER = 'EntityPhoneNumber';- public const string FIELD_PRIMARY = 'primary';-/*** @param string $value* @return voiddiff --git a/tests/integration/Espo/Core/Authentication/Oidc/UserInfoPopulatorTest.php b/tests/integration/Espo/Core/Authentication/Oidc/UserInfoPopulatorTest.phpindex 6d7d9d63f6..383e77f951 100644--- a/tests/integration/Espo/Core/Authentication/Oidc/UserInfoPopulatorTest.php+++ b/tests/integration/Espo/Core/Authentication/Oidc/UserInfoPopulatorTest.php@@ -104,8 +104,8 @@ class UserInfoPopulatorTest extends BaseTestCase$em->saveEntity($user);$em->refreshEntity($user);- $this->assertNull($user->getEmailAddress());- $this->assertNull($user->getPhoneNumber());+ $this->assertEquals('[email protected]', $user->getEmailAddress());+ $this->assertEquals('+200', $user->getPhoneNumber());$this->assertCount(1, $user->getEmailAddressGroup()->getList());$this->assertCount(1, $user->getPhoneNumberGroup()->getList());