From 42f05ea7d8b6d6d33a70d3fe903f5fb041cb2325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B0=D0=B2=D0=B5=D0=BB?= Date: Tue, 29 Sep 2020 15:47:16 +0300 Subject: [PATCH] fix updater crash --- CHANGELOG.md | 3 +++ intaro.retailcrm/install/version.php | 4 ++-- intaro.retailcrm/update/updater-5.5.0.php | 11 +++++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34982ecf..c4b9891c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2020-09-29 v.5.5.2 +* Исправлена ошибка, препятствовавшая обновлению модуля + ## 2020-09-28 v.5.5.1 * Исправлена ошибка переноса полей в retailCRM для заказов с интеграционными доставками diff --git a/intaro.retailcrm/install/version.php b/intaro.retailcrm/install/version.php index 442ecba0..400463f6 100644 --- a/intaro.retailcrm/install/version.php +++ b/intaro.retailcrm/install/version.php @@ -1,5 +1,5 @@ "5.5.1", - "VERSION_DATE" => "2020-09-28 13:44:00" + "VERSION" => "5.5.2", + "VERSION_DATE" => "2020-09-29 15:45:00" ); diff --git a/intaro.retailcrm/update/updater-5.5.0.php b/intaro.retailcrm/update/updater-5.5.0.php index 2ab0b0ea..053a0f3d 100644 --- a/intaro.retailcrm/update/updater-5.5.0.php +++ b/intaro.retailcrm/update/updater-5.5.0.php @@ -2,7 +2,14 @@ function update_5_5_0() { - if (!RetailcrmConfigProvider::shouldSendPaymentAmount()) { - RetailcrmConfigProvider::setSendPaymentAmount('Y'); + if (!class_exists('COption')) { + return; + } + + $mid = 'intaro.retailcrm'; + $option = 'send_payment_amount'; + + if (COption::GetOptionString($mid, $option, 'N') !== 'Y') { + COption::SetOptionString($mid, $option, 'Y'); } }