Jump to content

Recommended Posts

Bonjour à tous,

 

J'ai fait une mise à jour depuis la version 1.5.6.0 vers la version 1.6.0.6 et le bloc catégories plante toute la boutique.

 

Si je dé-greffe le bloc catégories, la boutique marche.

 

J'ai ceci comme message d'erreur : on dirait que la requête SQL n'est pas complète  ...

AND nleft >= AND nright <=

 

Auriez vous une idée de comment résoudre ce porblème svp ?

 

[PrestaShopDatabaseException]

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND nright <= AND c.id_category IN ( SELECT id_category FROM `ps_cat' at line 8
 

            SELECT 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` = 0)
            AND c.`id_category` != 1
             AND `level_depth` <= 4
            AND nleft >= AND nright <=
            AND c.id_category IN (
                SELECT id_category
                FROM `ps_category_group`
                WHERE `id_group` IN (3)
            )
            ORDER BY `level_depth` ASC, cl.`name` DESC

 

 

Merci d'avance,

Xavier

Share this post


Link to post
Share on other sites

Bonjour,

 

Vous avez bien fait une désinstallation et réinstallation complète du module ?

Share this post


Link to post
Share on other sites

Bonjour Mediacom87,

 

Oui j'ai fait une réinstallation du module mais j'ai découvert que cela venait de plus haut : j'ai installé le module "Comptant à la livraison" et cela fait pareil :/

Share this post


Link to post
Share on other sites

Hello,

 

i have exactly the same problem.

 

waiting for a solution.

 

thanks

Share this post


Link to post
Share on other sites

Ok !

 

So It's not a update problem !

 

May be another module create this bug : Did you add some modules ?

Share this post


Link to post
Share on other sites

no, the only think i did is put new products with rest webservices. I see that the error comes by 'category'. I delete all products but i can't remove stock_availables items...

 

at this moment i don't know to resolve this problem..any ideas?

Share this post


Link to post
Share on other sites

No, i have no idea :/

 

It look like to a sql request badly dynamicaly formed ...

 

Did you enable the debug mode and is it the same error than me ?

Share this post


Link to post
Share on other sites

yes... 

 

i think i updated some days ago a module but i don't remember which was..hope that someone search the same sql query at google at arrives here and tell us how to solucionate this!

 

:(

Edited by fuegonju (see edit history)

Share this post


Link to post
Share on other sites

Error comes from blockcategories module :

 

[PrestaShopDatabaseException]

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND nright <= AND c.id_category IN ( SELECT id_category FROM `ps_cat' at line 8
 

            SELECT 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` = 0)
            AND c.`id_category` != 1
             AND `level_depth` <= 4
            AND nleft >= AND nright <=
            AND c.id_category IN (
                SELECT id_category
                FROM `ps_category_group`
                WHERE `id_group` IN (1)
            )
            ORDER BY `level_depth` ASC, cl.`name` ASC

at line 635 in file classes/db/Db.php

 

629.             WebserviceRequest::getInstance()->setError(500, '
 '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);
630.         }
631.         else if (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))
632.         {
633.             if ($sql)
634.                 throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');
635.             throw new PrestaShopDatabaseException($this->getMsgError());
636.         }
637.     }
638.
639.     /**

Share this post


Link to post
Share on other sites

Bonjour

 

Nous sommes sur le forum  francophone     merci :) d'utiliser la langue française.

Share this post


Link to post
Share on other sites

En ce qui me concerne, même cas de figure : 1.6.0.6 en installation directe (pas de upgrade)

syntax error identique à celle de fuegonju...

merci d'avance aux experts :)

Share this post


Link to post
Share on other sites

J'ai déjà installé la 1.6.0.6 sans rencontrer ce problème avec les produits par défaut.

 

Et si c'était l’installation sans les produits de démonstration qui fait que le bloc catégorie dysfonctionne ?

 

Avez vous installé la 1.6.0.6 sans les produits de démonstration ?

Share this post


Link to post
Share on other sites

Bon j'y suis allé comme un sauvage : j'ai trouvé la ligne qui pose problème dans modules/blockcategories/blockcategories.php

 

J'ai commenté la ligne 207 car elle produit un bout de la requête SQL incomplète   AND nleft >= AND nright <= 

 

Si je fais un print_r de $category $category->nleft  et $category->nright sont vides :/

if ($category)
{
	if ($maxdepth > 0)
	$maxdepth += $category->level_depth;
// 	$range = 'AND nleft >= '.$category->nleft.' AND nright <= '.$category->nright;
}

 

Bon, je ne sais pas si ça produit une effet de bord quelque part ... mais le bloc catégorie a l'air de fonctionner :D

Edited by xavier777 (see edit history)

Share this post


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

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More