Erikku Posted September 15, 2012 Share Posted September 15, 2012 (edited) Un bug a ete introduit lors du commit 17375 Category.php ligne 634 Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').' Ca devrait probablement etre Shop::addSqlAssociation('image', 'i', false, 'i.cover=1').' L'erreur renvoyée [PrestaShopDatabaseException] Unknown column 'image_shop.cover' in 'on clause' SELECT p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity, product_attribute_shop.`id_product_attribute`, pl.`description`, pl.`description_short`, pl.`available_now`, pl.`available_later`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, image_shop.`id_image`, il.`legend`, m.`name` AS manufacturer_name, tl.`name` AS tax_name, t.`rate`, cl.`name` AS category_default, DATEDIFF(product_shop.`date_add`, DATE_SUB(NOW(), INTERVAL 20 DAY)) > 0 AS new, (product_shop.`price` * IF(t.`rate`,((100 + (t.`rate`))/100),1)) AS orderprice FROM `ps_category_product` cp LEFT JOIN `ps_product` p ON p.`id_product` = cp.`id_product` INNER JOIN ps_product_shop product_shop ON (product_shop.id_product = p.id_product AND product_shop.id_shop = 1) LEFT JOIN `ps_product_attribute` pa ON (p.`id_product` = pa.`id_product`) LEFT JOIN ps_product_attribute_shop product_attribute_shop ON (product_attribute_shop.id_product_attribute = pa.id_product_attribute AND product_attribute_shop.id_shop = 1 AND product_attribute_shop.`default_on` = 1) LEFT JOIN ps_stock_available stock ON (stock.id_product = p.id_product AND stock.id_product_attribute = IFNULL(`product_attribute_shop`.id_product_attribute, 0) AND stock.id_shop = 1 ) LEFT JOIN `ps_category_lang` cl ON (product_shop.`id_category_default` = cl.`id_category` AND cl.`id_lang` = 1 AND cl.id_shop = 1 ) LEFT JOIN `ps_product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = 1 AND pl.id_shop = 1 ) LEFT JOIN `ps_image` i ON (i.`id_product` = p.`id_product`) LEFT JOIN ps_image_shop image_shop ON (image_shop.id_image = i.id_image AND image_shop.id_shop = 1 AND image_shop.cover=1) LEFT JOIN `ps_image_lang` il ON (image_shop.`id_image` = il.`id_image` AND il.`id_lang` = 1) LEFT JOIN `ps_tax_rule` tr ON (product_shop.`id_tax_rules_group` = tr.`id_tax_rules_group` AND tr.`id_country` = 21 AND tr.`id_state` = 0 AND tr.`zipcode_from` = 0) LEFT JOIN `ps_tax` t ON (t.`id_tax` = tr.`id_tax`) LEFT JOIN `ps_tax_lang` tl ON (t.`id_tax` = tl.`id_tax` AND tl.`id_lang` = 1) LEFT JOIN `ps_manufacturer` m ON m.`id_manufacturer` = p.`id_manufacturer` WHERE product_shop.`id_shop` = 1 AND ((product_attribute_shop.id_product_attribute IS NOT NULL OR pa.id_product_attribute IS NULL) OR (product_attribute_shop.id_product_attribute IS NULL AND pa.default_on=1)) AND ((image_shop.id_image IS NOT NULL OR i.id_image IS NULL) OR (image_shop.id_image IS NULL AND i.cover=1)) AND cp.`id_category` = 2 AND product_shop.`active` = 1 AND product_shop.`visibility` IN ("both", "catalog") ORDER BY cp.`position` ASC LIMIT 0,8 Edited September 16, 2012 by Erikku (see edit history) Link to comment Share on other sites More sharing options...
Erikku Posted September 16, 2012 Author Share Posted September 16, 2012 En fait il me manquait une upgrade de la DB.. Link to comment Share on other sites More sharing options...
Erikku Posted September 16, 2012 Author Share Posted September 16, 2012 Et s'il me manquait une upgrade de la DB c'est parce qu'il a un patch sql 1.5.0.18 mais que dans install\install_version.php on a toujours: define('_PS_INSTALL_VERSION_', '1.5.0.17'); A fixer donc je pense. Et puis le script SQL est a fixé aussi car il ne set pas le nouveau champ cover de la table image_shop donc les images n'apparaissent plus pour les produits. Il semblerait qu'il suffise de mettre a 1 le champ "cover" dans la table image_shop de la meme facon que dans la table image. Link to comment Share on other sites More sharing options...
Erikku Posted September 19, 2012 Author Share Posted September 19, 2012 Y-a-t-il quelqu'un qui utilise les versions dev? Link to comment Share on other sites More sharing options...
doekia Posted September 19, 2012 Share Posted September 19, 2012 Oui j'ai une dev rafraichie toute les nuits mais je ne fait que des install fraiches pour l'instant Link to comment Share on other sites More sharing options...
Erikku Posted September 20, 2012 Author Share Posted September 20, 2012 doekia, Meme si tu fais des "install fraiches", il doit te manquer des champs dans la DB et tu dois avoir une erreur des que tu accedes a une categories par exemple. diguiding, Le champ ne manque pas vraiment, il est dans le patch 1.5.0.18.sql. Mais le patch n'est pas executé puisque la version est restée a 1.5.0.17. Link to comment Share on other sites More sharing options...
doekia Posted September 20, 2012 Share Posted September 20, 2012 Lors d'un upgrade c'est bien 1.5.0.18.sql qui assure la cohérence du schema: ALTER TABLE `PREFIX_image_shop` ADD `cover` TINYINT(1) UNSIGNED NOT NULL AFTER `id_shop`; ALTER TABLE `PREFIX_image_shop` DROP PRIMARY KEY; ALTER TABLE `PREFIX_image_shop` ADD ADD INDEX (`id_image`, `id_shop`, `cover`); Lors d'une nouvelle install c'est db_structure.sql CREATE TABLE `PREFIX_image_shop` ( `id_image` INT( 11 ) UNSIGNED NOT NULL, `id_shop` INT( 11 ) UNSIGNED NOT NULL, `cover` tinyint(1) NOT NULL, KEY (`id_image`, `id_shop`, `cover`), KEY `id_shop` (`id_shop`) ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; Donc je n'ai pas de manque dans mon schema Link to comment Share on other sites More sharing options...
Jean-Bruno Posted October 3, 2012 Share Posted October 3, 2012 Salut Je n'ai pas compris la résolution du problème. En injectant directement le 1.5.0.18 dans la base j'ai une erreur Erreur requête SQL: ALTER TABLE `PREFIX_image_shop` ADD `cover` TINYINT( 1 ) UNSIGNED NOT NULL AFTER `id_shop` ; MySQL a répondu: #1146 - Table '*****_PSrc.PREFIX_image_shop' doesn't exist Link to comment Share on other sites More sharing options...
doekia Posted October 3, 2012 Share Posted October 3, 2012 Salut Je n'ai pas compris la résolution du problème. En injectant directement le 1.5.0.18 dans la base j'ai une erreur Erreur requête SQL: ALTER TABLE `PREFIX_image_shop` ADD `cover` TINYINT( 1 ) UNSIGNED NOT NULL AFTER `id_shop` ; MySQL a répondu: #1146 - Table '*****_PSrc.PREFIX_image_shop' doesn't exist Désolé bruno mais ... ceci est valable pour toute action que tu fais. Ne la fait pas si tu n'a pas la moindre compréhension de quoi il en retourne. Ici c'est une requête SQL ... elle modifie la base de donnée. Tu dois VERIFIER si tu as besoin d'appliquer une correction. Et tu dois bien sur replacer PREFIX pas ton préfixe. Enfin j'ai copié ici pour simplification le schema tel qu'il doit être au final pas la méthode d'adaptation de ce dernier qui varie selon ton installaton à la base 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