email: do not re-add users on save

This commit is contained in:
Yuri Kuznetsov
2025-02-20 16:56:47 +02:00
parent 963b9e9e59
commit bf28abc4ca
+10 -1
View File
@@ -96,13 +96,22 @@ class Email extends Database implements
return;
}
$previousIds = [];
if (!$entity->isNew()) {
$previousIds = $entity->getFetchedLinkMultipleIdList($link);
}
$addressList = $this->explodeAndPrepareAddressList($addressValue);
$ids = $this->getEmailAddressRepository()->getIdListFormAddressList($addressList);
$entity->setLinkMultipleIdList($link, $ids);
if ($skipUsers) {
if (
$skipUsers ||
array_diff($previousIds, $ids) === array_diff($ids, $previousIds)
) {
return;
}