Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Sign Up

Ошибка Fatal error: Call to a member function apiVersions() on null


Recommended Posts

Помогите решить проблему или подскажите где искать. Ставлю официальный модуль RetailCRM, почему-то при сохранении настроек вылазить ошибка Fatal error: Call to a member function apiVersions() on null in /home/admin/controller/extension/module/retailcrm.php on line 622 Вот функция на которую ругается. Строка 622 - $response = $apiClient->apiVersions();

 

private function validate()
    {
        $versionsMap = array(
            'v3' => '3.0',
            'v4' => '4.0',
            'v5' => '5.0'
        );

        if (!empty($this->request->post[$this->moduleTitle . '_url']) && !empty($this->request->post[$this->moduleTitle . '_apikey'])) {
            $apiClient = $this->retailcrm->getApiClient(
                $this->request->post[$this->moduleTitle . '_url'],
                $this->request->post[$this->moduleTitle . '_apikey']
            );
        }

        $response = $apiClient->apiVersions();

        if ($response && $response->isSuccessful()) {
            if (!in_array($versionsMap[$this->request->post[$this->moduleTitle . '_apiversion']], $response['versions'])) {
                $this->_error['warning'] = $this->language->get('text_error_api');
            }
        } else {
            $this->_error['warning'] = $this->language->get('text_error_save');
        }

        if (!$this->user->hasPermission('modify', 'extension/module/retailcrm')) {
            $this->_error['warning'] = $this->language->get('error_permission');
        }

        if (isset($this->request->post[$this->moduleTitle . '_collector']['custom']) &&
            $this->request->post[$this->moduleTitle . '_collector']['custom_form'] == 1) {
            $customField = $this->request->post[$this->moduleTitle . '_collector']['custom'];

            if (empty($customField['name']) && empty($customField['email']) && empty($customField['phone'])) {
                $this->_error['fields'] = $this->language->get('text_error_collector_fields');
            }
        }

        if (!$this->_error) {
            return true;
        } else {
            return false;
        }
    }

Пробовал ставить на чистый OpenCart, та же ошибка, сервер работает на CentOS 7, php 5.6.36, OpenCart 2.3.0.2

Link to post
Share on other sites

Подскажите какой-то временный костыль чтобы запустить интеграцию или хотя бы объяснить что не так с данной строкой, почему приходит пустое значение, так как тех. поддержка данной CRM очень долго решает данный вопрос и пока что без результата.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.