Jump to content

1.7.5 [PrestaShopDatabaseException] Unknown column 'location' in 'field list'


Recommended Posts

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.     }
Link to comment
Share on other sites

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 by EvilDragon (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 1 month later...
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

  • 5 months later...
  • 1 month later...

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

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...