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); + } }