USB83 Posted May 10, 2019 Share Posted May 10, 2019 Bonjour Pour faire quelques tests sans toucher à la version en ligne du site, j'ai voulu installer une version locale pour bricoler dessus. Après avoir importé la base de données, j'ai corrigé les infos du fichier settings.inc.php et la tablea shop_url Quand j'essaye d'accéder au site j'ai ces erreurs : [PrestaShopDatabaseException] Expression #1 of ORDER BY clause is not in SELECT list, references column 'prestashop_restore.c.level_depth' which is not in SELECT list; this is incompatible with DISTINCT SELECT DISTINCT c.id_parent, c.id_category, cl.name, cl.description, cl.link_rewrite FROM `ps_category` c INNER JOIN ps_category_shop category_shop ON (category_shop.id_category = c.id_category AND category_shop.id_shop = 1) LEFT JOIN `ps_category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.`id_lang` = 1 AND cl.id_shop = 1 ) LEFT JOIN `ps_category_group` cg ON (cg.`id_category` = c.`id_category`) WHERE (c.`active` = 1 OR c.`id_category` = 1) AND `level_depth` <= 4 AND cg.`id_group` IN (1) ORDER BY `level_depth` ASC, category_shop.`position` ASC at line 639 in file classes/db/Db.php 634. WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97); 635. } 636. elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) 637. { 638. if ($sql) 639. throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>'); 640. throw new PrestaShopDatabaseException($this->getMsgError()); 641. } 642. } 643. 644. /** DbCore->displayError - [line 333 - classes/db/Db.php] - [1 Arguments] DbCore->query - [line 509 - classes/db/Db.php] - [1 Arguments] DbCore->executeS - [line 304 - modules/blockcategories/blockcategories.php] - [1 Arguments] BlockCategories->hookFooter - [line 512 - classes/Hook.php] - [1 Arguments] HookCore::exec - [line 832 - classes/controller/FrontController.php] - [1 Arguments] FrontControllerCore->initFooter - [line 185 - classes/controller/Controller.php] ControllerCore->run - [line 374 - classes/Dispatcher.php] DispatcherCore->dispatch - [line 80 - index.php] Quelques pistes sur la raison de ces erreurs ? Merci ! Link to comment Share on other sites More sharing options...
Eolia Posted May 10, 2019 Share Posted May 10, 2019 (edited) corrigez line 304 - modules/blockcategories/blockcategories.php En gros ca demande de filtrer par level_depth mais cette colonne n'est pas dans la sélection (difficile de trier suivant une colonne inexistante^^) SELECT DISTINCT c.id_parent, c.id_category, cl.name, cl.description, cl.link_rewrite Votre version sql en local doit être plus récente et ne laisse pas passer ce genre d'erreurs. Edited May 10, 2019 by Eolia (see edit history) Link to comment Share on other sites More sharing options...
USB83 Posted May 10, 2019 Author Share Posted May 10, 2019 Merci pour la réponse. Possible me proposer une piste pour corriger ça ? (je n'ai aucune idée de comment faire ) Merci encore Link to comment Share on other sites More sharing options...
Eolia Posted May 10, 2019 Share Posted May 10, 2019 ben éditez le fichier du module et ajoutez ce qu'il manque: SELECT DISTINCT c.id_parent, c.id_category, cl.name, cl.description, cl.link_rewrite, c.level_depth Link to comment Share on other sites More sharing options...
USB83 Posted May 13, 2019 Author Share Posted May 13, 2019 Donc au départ j'avais cette erreur : Expression #1 of ORDER BY clause is not in SELECT list, references column 'prestashop_restore.c.level_depth' which is not in SELECT list; this is incompatible with DISTINCT SELECT DISTINCT c.id_parent, c.id_category, cl.name, cl.description, cl.link_rewrite FROM `ps_category` c INNER JOIN `ps_category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.`id_lang` = 1 AND cl.id_shop = 1 ) INNER JOIN `ps_category_shop` cs ON (cs.`id_category` = c.`id_category` AND cs.`id_shop` = 1) WHERE (c.`active` = 1 OR c.`id_category` = 2) AND c.`id_category` != 1 AND `level_depth` <= 4 AND c.id_category IN (SELECT id_category FROM `ps_category_group` WHERE `id_group` IN (1)) ORDER BY `level_depth` ASC, cs.`position` ASC Quand j'ajoute c.level_depth, j'obtiens cette erreur : Expression #2 of ORDER BY clause is not in SELECT list, references column 'prestashop_restore.category_shop.position' which is not in SELECT list; this is incompatible with DISTINCT SELECT DISTINCT c.id_parent, c.id_category, cl.name, cl.description, cl.link_rewrite, c.level_depth FROM `ps_category` c INNER JOIN ps_category_shop category_shop ON (category_shop.id_category = c.id_category AND category_shop.id_shop = 1) LEFT JOIN `ps_category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.`id_lang` = 1 AND cl.id_shop = 1 ) LEFT JOIN `ps_category_group` cg ON (cg.`id_category` = c.`id_category`) WHERE (c.`active` = 1 OR c.`id_category` = 1) AND `level_depth` <= 4 AND cg.`id_group` IN (1) ORDER BY `level_depth` ASC, category_shop.`position` ASC Merci encore de prendre le temps de répondre Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now