From 22c3cd6d78a8bf396ba2241036cfd6272b66e32f Mon Sep 17 00:00:00 2001 From: Ivan Chaplygin Date: Tue, 21 Nov 2023 16:57:24 +0300 Subject: [PATCH] ref #91900 check exists clientId --- retailcrm/lib/settings/RetailcrmSettings.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/retailcrm/lib/settings/RetailcrmSettings.php b/retailcrm/lib/settings/RetailcrmSettings.php index 16cb4e6..1740ff2 100644 --- a/retailcrm/lib/settings/RetailcrmSettings.php +++ b/retailcrm/lib/settings/RetailcrmSettings.php @@ -71,9 +71,12 @@ class RetailcrmSettings if ($this->validator->validate(true)) { $this->settings->updateValueAll(); - if (array_key_exists('apiKey', $this->settings->getChanged())) { + $shopId = Context::getContext()->shop->id; + + if (array_key_exists('apiKey', $this->settings->getChanged()) + && !Configuration::get(RetailCRM::CLIENT_ID, null, null, $shopId)) { $this->setClientId(); - RetailCRM::updateCrmModuleState(Context::getContext()->shop->id); + RetailCRM::updateCrmModuleState($shopId); } }