Skip to content

Commit

Permalink
Fix validate form on saved settings (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
iyzoer authored and gwinn committed Aug 18, 2017
1 parent 82d93de commit 05a47a9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions admin/controller/extension/module/retailcrm.php
Original file line number Diff line number Diff line change
Expand Up @@ -544,9 +544,9 @@ private function validate()
);
}

$response = $this->retailcrm->statisticUpdate();
$response = $this->retailcrm->deliveryTypesList();

if ($response['errorMsg'] == 'API method not found') {
if ($response == false) {
$this->_error['warning'] = $this->language->get('text_error_api');
}

Expand Down
2 changes: 1 addition & 1 deletion admin/language/en-gb/extension/module/retailcrm.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
$_['field_phone'] = 'Phone';
$_['text_require'] = 'Require';
$_['text_error_collector_fields']= 'Fill in the field names Daemon Collector';
$_['text_error_api'] = 'The selected version of the API is unavailable';
$_['text_error_api'] = 'The selected version of the API or method is unavailable';

$_['retailcrm_dict_delivery'] = 'Shipment methods';
$_['retailcrm_dict_status'] = 'Order statuses';
Expand Down
2 changes: 1 addition & 1 deletion admin/language/ru-ru/extension/module/retailcrm.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
$_['field_phone'] = 'Телефон';
$_['text_require'] = 'Обязательно для заполнения';
$_['text_error_collector_fields']= 'Заполните названия полей формы Демон Collector';
$_['text_error_api'] = 'Недоступна выбранная версия API';
$_['text_error_api'] = 'Недоступна выбранная версия API или метод.';

$_['retailcrm_dict_delivery'] = 'Способы доставки';
$_['retailcrm_dict_status'] = 'Статусы';
Expand Down
3 changes: 2 additions & 1 deletion system/library/retailcrm/RetailcrmProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ class RetailcrmProxy
private $api;
private $log;

public function __construct($url, $key, $log, $version = 'v4')
public function __construct($url, $key, $log, $version)
{
if (!$version) $version = 'v4';
switch ($version) {
case 'v5':
$this->api = new RetailcrmApiClient5($url, $key);
Expand Down

0 comments on commit 05a47a9

Please sign in to comment.