Помощь Слетает категория при редактировании. MySQL ошибка

Apppxu

Постоялец
Регистрация
2 Апр 2013
Сообщения
84
Реакции
6
Ошибка из журнала
Код:
2018-07-26 17:54:32 - PHP Warning:  mysqli::query() [<a href='mysqli.query'>mysqli.query</a>]: (21000/1242): Subquery returns more than 1 row in /home/var/site.ru/www/system/library/db/mysqli.php on line 19

2018-07-26 17:54:32 - PHP Notice:  Error: Subquery returns more than 1 row<br />Error No: 1242<br />SELECT DISTINCT *, (SELECT GROUP_CONCAT(cd1.name ORDER BY level SEPARATOR '  >  ') FROM oc_category_path cp LEFT JOIN oc_category_description cd1 ON (cp.path_id = cd1.category_id AND cp.category_id != cp.path_id) WHERE cp.category_id = c.category_id AND cd1.language_id = '2' GROUP BY cp.category_id) AS path, (SELECT DISTINCT keyword FROM oc_url_alias WHERE query = 'category_id=59') AS keyword FROM oc_category c LEFT JOIN oc_category_description cd2 ON (c.category_id = cd2.category_id) WHERE c.category_id = '59' AND cd2.language_id = '2' in /home/var/site.ru/www/system/library/db/mysqli.php on line 41

2018-07-26 17:54:32 - PHP Notice:  Trying to get property of non-object in /home/var/site.ru/www/vqmod/vqcache/vq2-admin_model_catalog_category.php on line 237
Функция с vq2-admin_model_catalog_category.php 237 строка return return $query->row;
PHP:
    public function getCategory($category_id) {
        $query = $this->db->query("SELECT DISTINCT *, (SELECT GROUP_CONCAT(cd1.name ORDER BY level SEPARATOR '&nbsp;&nbsp;&gt;&nbsp;&nbsp;') FROM " . DB_PREFIX . "category_path cp LEFT JOIN " . DB_PREFIX . "category_description cd1 ON (cp.path_id = cd1.category_id AND cp.category_id != cp.path_id) WHERE cp.category_id = c.category_id AND cd1.language_id = '" . (int)$this->config->get('config_language_id') . "' GROUP BY cp.category_id) AS path, (SELECT DISTINCT keyword FROM " . DB_PREFIX . "url_alias WHERE query = 'category_id=" . (int)$category_id . "') AS keyword FROM " . DB_PREFIX . "category c LEFT JOIN " . DB_PREFIX . "category_description cd2 ON (c.category_id = cd2.category_id) WHERE c.category_id = '" . (int)$category_id . "' AND cd2.language_id = '" . (int)$this->config->get('config_language_id') . "'");

        return $query->row;
    }

mysqli.php стандартный. Нужно оттуда также код строк с ошибками?
 
Назад
Сверху