Jump to content

Please help with error MySLQ Error in back office


Recommended Posts

Hi Tommerg3

 

Thanks for your help and sorry for not stating what ps i am using

Im using ps 1.5.4

 

I turn on dev mode as you said above and it shows the following error message below</p>

 

I have a fresh install of prestashop, I added a few products and category's, then i deleted 2 catgegorys and the error message come up when i tried to view the products

 

Thanks so much for your help

 

[PrestaShopDatabaseException]

Unknown column 'cp.position' in 'field list'

 

SELECT SQL_CALC_FOUND_ROWS

a.`id_product`,b.name as name,`reference`,a.price as price,a.active as active,cp.position as position

, MAX(i.id_image) id_image,cl.name `name_category` , i.`id_image`, a.`price`, 0 AS price_final, sav.`quantity` as sav_quantity, a.`active`

FROM `ps_product` a

LEFT JOIN `ps_product_lang` b ON (b.`id_product` = a.`id_product` AND b.`id_lang` = 1 AND b.`id_shop` = 1)

LEFT JOIN `ps_image` i ON (i.`id_product` = a.`id_product` AND i.cover=1)LEFT JOIN `ps_category_lang` cl ON (a.`id_category_default` = cl.`id_category` AND b.`id_lang` = cl.`id_lang` AND cl.id_shop = 1)

LEFT JOIN `ps_stock_available` sav ON (sav.`id_product` = a.`id_product` AND sav.`id_product_attribute` = 0

AND sav.id_shop = 1 )

 

WHERE 1

GROUP BY a.id_product

 

ORDER BY cp.`position` ASC LIMIT 0,50

 

 

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

 

601. WebserviceRequest::getInstance()->setError(500, '

 '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);

602. }

603. else if (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))

604. {

605. if ($sql)

606. throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');

607. throw new PrestaShopDatabaseException($this->getMsgError());

608. }

609. }

610.

611. /**

 

DbCore->displayError - [line 307 - classes/db/Db.php] - [1 Arguments]

DbCore->query - [line 482 - classes/db/Db.php] - [1 Arguments]

DbCore->executeS - [line 2198 - classes/controller/AdminController.php] - [1 Arguments]

AdminControllerCore->getList - [line 337 - controllers/admin/AdminProductsController.php] - [6 Arguments]

AdminProductsControllerCore->getList - [line 1531 - classes/controller/AdminController.php] - [1 Arguments]

AdminControllerCore->renderList - [line 2260 - controllers/admin/AdminProductsController.php] - [0 Argument]

AdminProductsControllerCore->renderList - [line 1440 - classes/controller/AdminController.php] - [0 Argument]

AdminControllerCore->initContent - [line 2252 - controllers/admin/AdminProductsController.php] - [0 Argument]

AdminProductsControllerCore->initContent - [line 167 - classes/controller/Controller.php] - [0 Argument]

ControllerCore->run - [line 349 - classes/Dispatcher.php] - [0 Argument]

DispatcherCore->dispatch - [line 50 - admin123/index.php] - [0 Argument]

Edited by cheap gaming pcs (see edit history)
Link to comment
Share on other sites

It seems that the query is invalid, it tried to select cp.position when a table with the name cp (which is category_product) is not a part of the "FROM" or a "LEFT JOIN"

 

I tried to take a quick look, but I want not able to identify the exact cause.

 

I suggest you start a thread in the bug tracker, provide all the info from the last post, and see what the PS team will find.

Link to comment
Share on other sites

  • 2 weeks later...

Hi All,

 

I had the same problem when using Firefox. When I tried Safari the problem was solved.

The problem was fixed when I deleted my cookies in FireFox, but eventually they came back.....

 

Hope this helps!

 

grts

  • Like 1
Link to comment
Share on other sites

Hi motuman84, are you saying that this problem is not fixed overall?

Hi Benjamin, I'm not an expert in this field but I haven't changed anything in PS to make it go away. I discovered that when I deleted my cookies in Firefox it was gone. Strange that Safari worked fine? But it came back, so if there's a solution, let me know:)

btw: I'm working with the new PS 1.5.4 (works great, nice job all !) on a Mac

Link to comment
Share on other sites

  • 2 months later...
  • 3 months later...

Thanks Pascal,

I've tried with an other navigator but didn't work for me.

So I checked my information files with with 1Click upgrade and prestashop found 68 files modified (?)
So i replace each one by ftp.

Now the error has gone.

 

Thank you

Link to comment
Share on other sites

  • 10 months later...
×
×
  • Create New...