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

Link to comment
Share on other sites

  • 2 weeks later...

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?

Link to comment
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.     /**
Link to comment
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 ?

Link to comment
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)
Link to comment
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...