From ecb845546df16208c41517e44bd2a71dacc47549 Mon Sep 17 00:00:00 2001 From: Neur0toxine Date: Wed, 26 Aug 2020 11:21:56 +0300 Subject: [PATCH] fix order upload error during installation (#125) --- CHANGELOG.md | 3 ++ .../classes/general/ApiClient_v5.php | 39 ------------------- intaro.retailcrm/description.ru | 4 +- intaro.retailcrm/include.php | 2 +- intaro.retailcrm/install/index.php | 1 + intaro.retailcrm/install/version.php | 4 +- 6 files changed, 8 insertions(+), 45 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3edbd4ff..d6a551f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2020-08-26 v.5.4.4 +* Исправлена ошибка при установке модуля + ## 2020-08-25 v.5.4.3 * Исправлена ошибка с некорректным ID товара при редактировании заказа * Исправлены опечатки в API-клиенте retailCRM diff --git a/intaro.retailcrm/classes/general/ApiClient_v5.php b/intaro.retailcrm/classes/general/ApiClient_v5.php index 7370e8f6..d3358024 100644 --- a/intaro.retailcrm/classes/general/ApiClient_v5.php +++ b/intaro.retailcrm/classes/general/ApiClient_v5.php @@ -349,45 +349,6 @@ class ApiClient ); } - /** - * Edit a customer corporate - * - * @param array $customer customer data - * @param string $by (default: 'externalId') - * @param string $site (default: null) - * - * @throws \InvalidArgumentException - * @throws \RetailCrm\Exception\CurlException - * @throws \RetailCrm\Exception\InvalidJsonException - * - * @return ApiResponse - */ - public function customersCorporateEdit(array $customer, $by = 'externalId', $site = null) - { - if (!count($customer)) { - throw new \InvalidArgumentException( - 'Parameter `customer` must contains a data' - ); - } - - $this->checkIdParameter($by); - - if (!array_key_exists($by, $customer)) { - throw new \InvalidArgumentException( - sprintf('Customer array must contain the "%s" parameter.', $by) - ); - } - - return $this->client->makeRequest( - sprintf('/customers-corporate/%s/edit', $customer[$by]), - Client::METHOD_POST, - $this->fillSite( - $site, - array('customerCorporate' => json_encode($customer), 'by' => $by) - ) - ); - } - /* * Get customers corporate history * diff --git a/intaro.retailcrm/description.ru b/intaro.retailcrm/description.ru index 8034c39f..aa1db64b 100644 --- a/intaro.retailcrm/description.ru +++ b/intaro.retailcrm/description.ru @@ -1,3 +1 @@ -- Исправлена ошибка с некорректным ID товара при редактировании заказа -- Исправлены опечатки в API-клиенте retailCRM -- Добавлена фильтрация изменений истории по текущему API-ключу +- Исправлена ошибка при установке модуля diff --git a/intaro.retailcrm/include.php b/intaro.retailcrm/include.php index 0cf77116..f7eb8d87 100644 --- a/intaro.retailcrm/include.php +++ b/intaro.retailcrm/include.php @@ -38,6 +38,6 @@ CModule::AddAutoloadClasses( 'AddressBuilder' => 'classes/general/AddressBuilder.php', 'AbstractBuilder' => 'classes/general/AbstractBuilder.php', 'BaseModel' => 'classes/general/Model/BaseModel.php', - 'RetailCrmService' => 'classes/general/services/RetailCrmService.php', + 'RetailCrmService' => 'classes/general/services/RetailCrmService.php' ) ); diff --git a/intaro.retailcrm/install/index.php b/intaro.retailcrm/install/index.php index bc5be3dc..0565be7a 100644 --- a/intaro.retailcrm/install/index.php +++ b/intaro.retailcrm/install/index.php @@ -141,6 +141,7 @@ class intaro_retailcrm extends CModule include($this->INSTALL_PATH . '/../classes/general/Exception/CurlException.php'); include($this->INSTALL_PATH . '/../classes/general/RestNormalizer.php'); include($this->INSTALL_PATH . '/../classes/general/Logger.php'); + include($this->INSTALL_PATH . '/../classes/general/services/RetailCrmService.php'); $version = COption::GetOptionString($this->MODULE_ID, $this->CRM_API_VERSION, 0); if ($version == 'v4') { diff --git a/intaro.retailcrm/install/version.php b/intaro.retailcrm/install/version.php index a5bca5bc..f4488397 100644 --- a/intaro.retailcrm/install/version.php +++ b/intaro.retailcrm/install/version.php @@ -1,5 +1,5 @@ "5.4.3", - "VERSION_DATE" => "2020-08-25 11:20:00" + "VERSION" => "5.4.4", + "VERSION_DATE" => "2020-08-26 10:50:00" );