diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b34a84d..fab4aec6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2026-04-01 v6.7.10 +- Исправлена ошибка переноса данных между клиентами при синхронизации истории + ## 2026-03-16 v6.7.9 - Добавлена дополнительная проверка на наличие подписки у пользователя diff --git a/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php b/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php index aaff0daa..f4ecb5c7 100644 --- a/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php +++ b/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php @@ -126,9 +126,10 @@ public static function customerHistory() RetailcrmConfigProvider::setCustomersHistorySinceId($lastId['id']); $newUser = new CUser(); - $customerBuilder = new CustomerBuilder(); foreach ($customers as $customer) { + $customerBuilder = new CustomerBuilder(); + if (function_exists('retailCrmBeforeCustomerSave')) { $newResCustomer = retailCrmBeforeCustomerSave($customer); if (is_array($newResCustomer) && !empty($newResCustomer)) { @@ -144,11 +145,9 @@ public static function customerHistory() continue; } - if (RetailcrmConfigProvider::isPhoneRequired()) { - if (isset($customer['create']) && empty($customer['phones'])) { - Logger::getInstance()->write('$customer["phones"] is empty. Customer ' . $customer['id'] . ' cannot be created', 'createCustomerError'); - continue; - } + if (RetailcrmConfigProvider::isPhoneRequired() && !isset($customer['externalId']) && (!isset($customer['phones']) || count($customer['phones']) === 0)) { + Logger::getInstance()->write('$customer["phones"] is empty. Customer ' . $customer['id'] . ' cannot be created', 'createCustomerError'); + continue; } if (isset($customer['externalId']) && !is_numeric($customer['externalId'])) { diff --git a/intaro.retailcrm/install/version.php b/intaro.retailcrm/install/version.php index 5ccfb0cd..d5e2bb18 100644 --- a/intaro.retailcrm/install/version.php +++ b/intaro.retailcrm/install/version.php @@ -1,6 +1,6 @@ '6.7.9', - 'VERSION_DATE' => '2026-03-16 17:30:00' + 'VERSION' => '6.7.10', + 'VERSION_DATE' => '2026-04-01 17:30:00' ]; diff --git a/intaro.retailcrm/lib/component/constants.php b/intaro.retailcrm/lib/component/constants.php index 5a6a8dfe..3ccef2cb 100644 --- a/intaro.retailcrm/lib/component/constants.php +++ b/intaro.retailcrm/lib/component/constants.php @@ -18,7 +18,7 @@ */ class Constants { - public const MODULE_VERSION = '6.7.9'; + public const MODULE_VERSION = '6.7.10'; public const CRM_PURCHASE_PRICE_NULL = 'purchasePrice_null'; public const BITRIX_USER_ID_PREFIX = 'bitrixUserId-'; public const CRM_USERS_MAP = 'crm_users_map';