From 57419cadc6932d5f7ebb6dde82715fd8c39cdd87 Mon Sep 17 00:00:00 2001 From: Kocmonavtik <61938582+Kocmonavtik@users.noreply.github.com> Date: Thu, 8 Jun 2023 09:33:56 +0300 Subject: [PATCH] =?UTF-8?q?ref=20#89521=20=D0=98=D1=81=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BE=D1=88=D0=B8=D0=B1?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=BF=D1=80=D0=B8=20=D0=B8=D0=B7=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D0=B5=D0=BD=D0=B8=D0=B8=20=D0=BD=D0=B0=D1=81=D1=82=D1=80?= =?UTF-8?q?=D0=BE=D0=B5=D0=BA=20=D0=BC=D0=BE=D0=B4=D1=83=D0=BB=D1=8F=20(#2?= =?UTF-8?q?96)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +++ intaro.retailcrm/description.ru | 2 +- intaro.retailcrm/install/version.php | 4 ++-- intaro.retailcrm/options.php | 4 ++-- .../history/RetailCrmHistory_v5Test.php | 1 + .../general/order/RetailCrmOrder_v5Test.php | 20 +++++++++++++++++++ 6 files changed, 29 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ca02f90..c771aaa6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2023-06-07 v.6.3.11 +- Исправление критической ошибки при изменении настроек модуля + ## 2023-06-02 v.6.3.10 - Добавлено ограничение по магазинам для типов доставок и оплат diff --git a/intaro.retailcrm/description.ru b/intaro.retailcrm/description.ru index 6510969c..a8940393 100644 --- a/intaro.retailcrm/description.ru +++ b/intaro.retailcrm/description.ru @@ -1 +1 @@ -- Добавлено ограничение по магазинам для типов доставок и оплат \ No newline at end of file +- Исправление критической ошибки при изменении настроек модуля \ No newline at end of file diff --git a/intaro.retailcrm/install/version.php b/intaro.retailcrm/install/version.php index c5731a26..4895e48a 100644 --- a/intaro.retailcrm/install/version.php +++ b/intaro.retailcrm/install/version.php @@ -1,6 +1,6 @@ '6.3.10', - 'VERSION_DATE' => '2023-06-02 11:00:00' + 'VERSION' => '6.3.11', + 'VERSION_DATE' => '2023-06-07 18:00:00' ]; diff --git a/intaro.retailcrm/options.php b/intaro.retailcrm/options.php index b69cb452..c6a3c308 100644 --- a/intaro.retailcrm/options.php +++ b/intaro.retailcrm/options.php @@ -688,8 +688,8 @@ if (isset($_POST['Update']) && ($_POST['Update'] === 'Y')) { COption::SetOptionString($mid, $EVENTS_DEACTIVATE, serialize($deactivateEvents)); } } else { - $deactivateAgents = unserialize(COption::GetOptionString($mid, $AGENTS_DEACTIVATE, [])); - $deactivateEvents = unserialize(COption::GetOptionString($mid, $EVENTS_DEACTIVATE, [])); + $deactivateAgents = unserialize(COption::GetOptionString($mid, $AGENTS_DEACTIVATE, '')); + $deactivateEvents = unserialize(COption::GetOptionString($mid, $EVENTS_DEACTIVATE, '')); if (!empty($deactivateAgents)) { $dateAgent = new DateTime(); diff --git a/tests/classes/general/history/RetailCrmHistory_v5Test.php b/tests/classes/general/history/RetailCrmHistory_v5Test.php index 37e1904c..44f87743 100644 --- a/tests/classes/general/history/RetailCrmHistory_v5Test.php +++ b/tests/classes/general/history/RetailCrmHistory_v5Test.php @@ -175,6 +175,7 @@ class RetailCrmHistory_v5Test extends \BitrixTestCase { $currency = CurrencyManager::getBaseCurrency(); $cmsOrder = Order::create('bitrix', 1, $currency); + $cmsOrder->setPersonTypeId('bitrixType'); $crmManagerId = 123; RetailcrmConfigProvider::setUsersMap(['bitrixUserId-1515' => $crmManagerId]); diff --git a/tests/classes/general/order/RetailCrmOrder_v5Test.php b/tests/classes/general/order/RetailCrmOrder_v5Test.php index bd81e843..d2212486 100644 --- a/tests/classes/general/order/RetailCrmOrder_v5Test.php +++ b/tests/classes/general/order/RetailCrmOrder_v5Test.php @@ -66,6 +66,7 @@ class RetailCrmOrder_v5Test extends BitrixTestCase { public function testFieldExists(): void { $order = \Bitrix\Sale\Order::create('s1', 1, 'RUB'); + $order->setPersonTypeId('bitrixType'); $flag = true; try { @@ -136,4 +137,23 @@ class RetailCrmOrder_v5Test extends BitrixTestCase { ], ]]; } + + /** + * @runInSeparateProcess + * @preserveGlobalState disabled + */ + public function testUploadOrders(): void + { + $dependencyLoader = Mockery::mock('alias:' . RetailcrmDependencyLoader::class); + $dependencyLoader->shouldReceive('loadDependencies')->withAnyArgs()->andReturn(true); + + COption::SetOptionString('intaro.retailcrm', \Intaro\RetailCrm\Component\Constants::CRM_SITES_LIST, serialize([])); + + $rcrmActions = Mockery::mock('alias:' . RCrmActions::class); + $rcrmActions->shouldReceive('apiMethod')->withAnyArgs()->andReturn(true); + + $result = RetailCrmOrder::uploadOrders(); + + self::assertTrue($result); + } }