Heikman Posted December 24, 2018 Share Posted December 24, 2018 hello everyone, I have a problem since I have updated to version 1.7.5. The following message appears when I try to open my Webshop: What can I do to fix the problem? Many thanks in advance. [PrestaShopDatabaseException] Unknown column 'location' in 'field list' SELECT location FROM `othe_stock_available` WHERE (id_product = 34) AND (id_product_attribute = 0) AND (id_shop = 1) AND (id_shop_group = 0) LIMIT 1 at line 769 in file classes/db/Db.php 764. if ($webservice_call && $errno) { 765. $dbg = debug_backtrace(); 766. WebserviceRequest::getInstance()->setError(500, '[SQL Error] ' . $this->getMsgError() . '. From ' . (isset($dbg[3]['class']) ? $dbg[3]['class'] : '') . '->' . $dbg[3]['function'] . '() Query was : ' . $sql, 97); 767. } elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) { 768. if ($sql) { 769. throw new PrestaShopDatabaseException($this->getMsgError() . '<br /><br /><pre>' . $sql . '</pre>'); 770. } 771. 772. throw new PrestaShopDatabaseException($this->getMsgError()); 773. } 774. } DbCore->displayError - [line 385 - classes/db/Db.php] - [1 Arguments] DbCore->query - [line 663 - classes/db/Db.php] - [1 Arguments] DbCore->getRow - [line 697 - classes/db/Db.php] - [2 Arguments] DbCore->getValue - [line 782 - classes/stock/StockAvailable.php] - [1 Arguments] Argument [0] SELECT location FROM `othe_stock_available` WHERE (id_product = 34) AND (id_product_attribute = 0) AND (id_shop = 1) AND (id_shop_group = 0) StockAvailableCore::getLocation - [line 6522 - classes/Product.php] - [1 Arguments] ProductCore->loadStockData - [line 164 - classes/Pack.php] PackCore::getItems - [line 131 - classes/Pack.php] - [2 Arguments] PackCore::noPackPrice - [line 4853 - classes/Product.php] - [1 Arguments] ProductCore::getProductProperties - [line 4924 - classes/Product.php] - [2 Arguments] ProductCore::getProductsProperties - [line 1021 - classes/Category.php] - [2 Arguments] CategoryCore->getProducts - [line 79 - src/Adapter/Category/CategoryProductSearchProvider.php] - [9 Arguments] PrestaShop\PrestaShop\Adapter\Category\CategoryProductSearchProvider->getProductsOrCount - [line 105 - src/Adapter/Category/CategoryProductSearchProvider.php] - [3 Arguments] PrestaShop\PrestaShop\Adapter\Category\CategoryProductSearchProvider->runQuery - [line 299 - modules/ps_featuredproducts/ps_featuredproducts.php] - [2 Arguments] Ps_FeaturedProducts->getProducts - [line 257 - modules/ps_featuredproducts/ps_featuredproducts.php] Ps_FeaturedProducts->getWidgetVariables - [line 243 - modules/ps_featuredproducts/ps_featuredproducts.php] - [2 Arguments] Ps_FeaturedProducts->renderWidget - [line 971 - classes/Hook.php] - [2 Arguments] HookCore::coreRenderWidget - [line 923 - classes/Hook.php] - [3 Arguments] HookCore::exec - [line 39 - controllers/front/IndexController.php] - [1 Arguments] IndexControllerCore->initContent - [line 281 - classes/controller/Controller.php] ControllerCore->run - [line 509 - classes/Dispatcher.php] DispatcherCore->dispatch - [line 28 - index.php] Link to comment Share on other sites More sharing options...
El Patron Posted December 26, 2018 Share Posted December 26, 2018 it seems there is leakage from old ps version (stock management) table ps_stock_available does not have 'location' in the table but did so in 1.6. so some left over code is looking up stock using parms from old stock manger. That is my guess! el Link to comment Share on other sites More sharing options...
EvilDragon Posted December 27, 2018 Share Posted December 27, 2018 (edited) No, it's the other way round. Location has been added with v1.7.5. It seems the Update has not run the MySQL update queries, so you should do that yourself. You can find them inside the Prestashop-ZIP-Archive (download the full installation from the website) inside install/upgrade/sql Run all the queries (in the correct order) from the version you upgraded from. EDIT: I had the same issue, and I think I know why. The SQL-Script has a bug! ALTER TABLE `PREFIX_supply_order_receipt_history` CHANGE `employee_firstname` `employee_firstname` VARCHAR(255) DEFAULT '', CHANGE `employee_lastname` `employee_firstname` VARCHAR(255) DEFAULT ''; That, of course, throws an error. It should be: ALTER TABLE `PREFIX_supply_order_receipt_history` CHANGE `employee_firstname` `employee_firstname` VARCHAR(255) DEFAULT '', CHANGE `employee_lastname` `employee_lastname` VARCHAR(255) DEFAULT ''; Also be sure to change all PREFIX in the file to your actual prefix in the database. This fixed my shop and it's now working well again (very same error message). EDIT2: There seem to be a couple more bugs. More info on that here:https://github.com/PrestaShop/PrestaShop/pull/11814/commits/1a20ad00cb37e04d4a5b9415f0e59c261930ba2c Edited December 27, 2018 by EvilDragon (see edit history) 1 Link to comment Share on other sites More sharing options...
El Patron Posted December 27, 2018 Share Posted December 27, 2018 thanks evil dragon! I need to clean my glasses Link to comment Share on other sites More sharing options...
ruloshop Posted February 6, 2019 Share Posted February 6, 2019 On 26/12/2018 at 20:24, EvilDragon said: No, es al revés. Se ha agregado la ubicación con v1.7.5. Parece que la Actualización no ha ejecutado las consultas de actualización de MySQL, por lo que debería hacerlo usted mismo. Puede encontrarlos en Prestashop-ZIP-Archive (descargue la instalación completa del sitio web) en instalar / actualizar / sql Ejecute todas las consultas (en el orden correcto) desde la versión desde la que se actualizó. EDIT: tuve el mismo problema, y creo que sé por qué. El SQL-Script tiene un error! Eso, por supuesto, arroja un error. Debería ser: También asegúrese de cambiar todos los PREFIX del archivo a su prefijo real en la base de datos. Esto solucionó mi tienda y ahora está funcionando bien nuevamente (muy el mismo mensaje de error). EDIT2: Parece que hay un par de errores más. Más información sobre eso aquí: https://github.com/PrestaShop/PrestaShop/pull/11814/commits/1a20ad00cb37e04d4a5b9415f0e59c261930ba2c hello I have the same problem after updating my store from 1.7.4 to 1.7.5 and try several ways to fix and nothing as meeting is part to change Link to comment Share on other sites More sharing options...
seek Posted August 2, 2019 Share Posted August 2, 2019 Hi, I've just delete VAR and OVERRIDE folders and replace them with new ones from the original PS install. It helped. 1 Link to comment Share on other sites More sharing options...
Endriu18 Posted September 4, 2019 Share Posted September 4, 2019 Hi, as pointed in documentation, You should run script in upgrade.php file https://devdocs.prestashop.com/1.7/basics/keeping-up-to-date/upgrade/ Database upgrade Once the files have been copied, your shop database is ready to be upgraded. All the changes to apply have been defined in the `install` folder, running them can be done with a specific PHP script. When you’re ready, run the file `install/upgrade/upgrade.php`. This can be done with a browser, by reaching the address http://<shop_domain>/install/upgrade/upgrade.php, or from your server’s command line: php install/upgrade/upgrade.php 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