Prestashop: 1054 Unknown column 't0.filter id' in 'field list when i upgrade 1.7.5.2 TO 1.7.6

Created on 12 Jul 2019  Â·  27Comments  Â·  Source: PrestaShop/PrestaShop

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Screenshots
If applicable, add screenshots or screenrecords to help explain your problem.

Additional information
PrestaShop version: N/A
PHP version: N/A

1.7.6.0 Autoupgrade BO Bug Fixed Minor Regression

Most helpful comment

Same issue when upgrading from 1.7.5.2 to 1.7.6.0 with 1-Click Upgrade 4.9.0 and PHP 7.2.
Upgrade process finished successfully.
BO page error are: products, category, brands, customers, cms pages, taxes, contacts, seo url, emails, employees, sql-requests, logs and webservice.

Column not found: 1054 Unknown column 't0.filter_id' in 'field list'

Provisional solution:

ALTER TABLE `ps_admin_filter` ADD `filter_id` INT NOT NULL ;

All 27 comments

HI,
When I upgrade v1.7.5.2 to 1.7.6 I have this error: 1054 Unknown column 't0.filter id' in 'field list.
And I can't access to the product and employee.
Please help me

Hi @yoss55,
Could you please try to clear cache manually by deleting all the folder into var/cache (prod & dev).
Can you please provide us the log of your upgrade? It can be found in the log.txt file, available in /autoupgrade/tmp/log.txt
Thanks!

hi,
this is the log :
[2019-07-12 08:09:31] Migrating old setting file...
[2019-07-12 08:09:31] parameters file already exists!
[2019-07-12 08:09:31] Finished...
[2019-07-12 10:09:31]

[OK] SQL 1.7.6.0 SET SESSION sql_mode = ''

[2019-07-12 10:09:31]
[OK] SQL 1.7.6.0 SET NAMES 'utf8'

[2019-07-12 10:09:31]
[OK] SQL 1.7.6.0 ALTER TABLE ps_currency ADD numeric_iso_code varchar(3) NOT NULL DEFAULT '0' AFTER iso_code

[2019-07-12 10:09:31]
[OK] SQL 1.7.6.0 ALTER TABLE ps_currency ADD precision int(2) NOT NULL DEFAULT 6 AFTER numeric_iso_code

[2019-07-12 10:09:32]
[OK] SQL 1.7.6.0 ALTER TABLE ps_currency ADD KEY currency_iso_code (iso_code)

[2019-07-12 10:09:32]
[DROP] SQL ps_currency_lang table has been dropped.

[2019-07-12 10:09:32]
[OK] SQL 1.7.6.0 /* Localized currency information */
CREATE TABLE ps_currency_lang (
id_currency int(10) unsigned NOT NULL,
id_lang int(10) unsigned NOT NULL,
name varchar(255) NOT NULL,
symbol varchar(255) NOT NULL,
PRIMARY KEY (id_currency,id_lang)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

[2019-07-12 10:09:32] [INTERNAL] /home/avenuedubijou/www/adminsite/autoupgrade/latest/install/upgrade/php/ps_1760_copy_data_from_currency_to_currency_lang.php line 55 - Error: Call to a member function get() on null

0 [internal function]: ps_1760_copy_data_from_currency_to_currency_lang()

1 /home/avenuedubijou/www/modules/autoupgrade/classes/UpgradeTools/CoreUpgrader/CoreUpgrader.php(372): call_user_func_array('ps_1760_copy_da...', Array)

2 /home/avenuedubijou/www/modules/autoupgrade/classes/UpgradeTools/CoreUpgrader/CoreUpgrader.php(340): PrestaShop\Module\AutoUpgrade\UpgradeTools\CoreUpgrader\CoreUpgrader->runPhpQuery('1.7.6.0', '/* PHP:ps_1760_...')

3 /home/avenuedubijou/www/modules/autoupgrade/classes/UpgradeTools/CoreUpgrader/CoreUpgrader.php(264): PrestaShop\Module\AutoUpgrade\UpgradeTools\CoreUpgrader\CoreUpgrader->runQuery('1.7.6.0', '/* PHP:ps_1760_...')

4 /home/avenuedubijou/www/modules/autoupgrade/classes/UpgradeTools/CoreUpgrader/CoreUpgrader17.php(52): PrestaShop\Module\AutoUpgrade\UpgradeTools\CoreUpgrader\CoreUpgrader->upgradeDb('1.7.5.2')

5 /home/avenuedubijou/www/modules/autoupgrade/classes/UpgradeTools/CoreUpgrader/CoreUpgrader.php(81): PrestaShop\Module\AutoUpgrade\UpgradeTools\CoreUpgrader\CoreUpgrader17->upgradeDb('1.7.5.2')

6 /home/avenuedubijou/www/modules/autoupgrade/classes/TaskRunner/Upgrade/UpgradeDb.php(41): PrestaShop\Module\AutoUpgrade\UpgradeTools\CoreUpgrader\CoreUpgrader->doUpgrade()

7 /home/avenuedubijou/www/adminsite/autoupgrade/ajax-upgradetab.php(52): PrestaShop\Module\AutoUpgrade\TaskRunner\Upgrade\UpgradeDb->run()

8 {main}

[2019-07-12 10:13:58] Restoring files ...

@yoss55, what is the exact version PHP did you use?

PHP 7.0.33

Hello, I had this issue with the upgrade module, as reported in https://github.com/PrestaShop/autoupgrade/issues/298

Did you upgrade the module before starting an upgrade? The last version is v4.9.0

yes i upgrade to V4.9.0

this the message
An exception occurred while executing 'SELECT t0.id AS id_1, t0.employee AS employee_2, t0.shop AS shop_3, t0.controller AS controller_4, t0.action AS action_5, t0.filter AS filter_6, t0.filter_id AS filter_id_7 FROM ps_admin_filter t0 WHERE t0.employee = ? AND t0.shop = ? AND t0.controller = ? AND t0.action = ? LIMIT 1' with params [1, 1, "employee", "index"]:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.filter_id' in 'field list'

Same issue. The sql upgrade file is missing the important PREFIX_admin_filter ADD COLUMN filter_id.

After I added this column manual to databse, the admin page Languages is working fine (no 500 error missing column)

I was going to add it again, but did you complete the upgrade process? Doctrine is supposed to add it.

Same issue when upgrading from 1.7.5.2 to 1.7.6.0 with 1-Click Upgrade 4.9.0 and PHP 7.2.
Upgrade process finished successfully.
BO page error are: products, category, brands, customers, cms pages, taxes, contacts, seo url, emails, employees, sql-requests, logs and webservice.

Column not found: 1054 Unknown column 't0.filter_id' in 'field list'

Provisional solution:

ALTER TABLE `ps_admin_filter` ADD `filter_id` INT NOT NULL ;

Hi ,
i resolved the problem
the issue :
when you look you’re module clik upgrade you see 4.9.0 but in fact you have the version 4.7.0

you must to restore you’re backup and you uninstall the module clik upgrade you downlode the module at prestashop you install it

you make the permission 777 after you upgrade and everithing it’s gone be ok !

Le 16 juil. 2019 à 11:21, Klemart3D <[email protected]notifications@github.com> a écrit :

Same issue when upgrading from 1.7.5.2 to 1.7.6.0 with 1-Click Upgrade 4.9.0 and PHP 7.2.
Upgrade process finished successfully.
BO page error are: products, category, brands, customers, cms pages, taxes, contacts, seo url, emails, employees, sql-requests, logs and webservice.

[Column not found: 1054 Unknown column 't0.filter_id' in 'field list']https://user-images.githubusercontent.com/7419525/61282153-1b48f580-a7bb-11e9-9a1a-dcb59c5ef69f.png

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/PrestaShop/PrestaShop/issues/14617?email_source=notifications&email_token=AMTA4OIRZOHTF67EWONPDJDP7WHLPA5CNFSM4ICI5MC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2AIAVA#issuecomment-511737940, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMTA4OOQL26D3RAIRNFKYJ3P7WHLPANCNFSM4ICI5MCQ.

Do you have a floating red star on SEO & URL page?
red-star

Hi @yoss55, @Klemart3D,

I did not manage to reproduce the issue with PS1.7.6.0 fresh install & after an upgrade from PS1.7.5.2
In fact, this issue is fixed in the last version of PS1.7.6.0.
Here's the PR: https://github.com/PrestaShop/PrestaShop/pull/14220 to fix the issue which is reported here: https://github.com/PrestaShop/PrestaShop/issues/14205

Thanks!

Same issue when upgrading from 1.7.5.2 to 1.7.6.0 with 1-Click Upgrade 4.9.0 and PHP 7.2.
Upgrade process finished successfully.
BO page error are: products, category, brands, customers, cms pages, taxes, contacts, seo url, emails, employees, sql-requests, logs and webservice.

Column not found: 1054 Unknown column 't0.filter_id' in 'field list'

Provisional solution:

ALTER TABLE `ps_admin_filter` ADD `filter_id` INT NOT NULL ;

Thanks a lot! You are my hero! Ran this SQL in my database, it finally resolved!

I have simillar error when try to open Catalog->Brands in the Back Office.

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'id_lang' in 'order clause'
Zrzut ekranu 2019-07-29 o 16 48 20

How to solve it?

Hi @coffeebean19,

It is fixed in the next version PS1.7.6.1.
You can follow this comment to solve your issue: https://github.com/PrestaShop/PrestaShop/issues/14617#issuecomment-511737940

Thanks!

Hi @coffeebean19,

It is fixed in the next version PS1.7.6.1.
You can follow this comment to solve your issue: #14617 (comment)

Thanks!

Already did it, but not working for brands page.

Here is the missing data:
Zrzut ekranu 2019-07-29 o 21 12 56

If i fill it and refresh the brand page it starts again and clean database.

Zrzut ekranu 2019-07-29 o 21 13 15

PS. When 1.7.6.1 will be available?

So I upgraded 1.7.5.2 to 1.7.6.0 with the known problems: fields are missing in database. Only 1 fix is given here "ALTER TABLE ps_admin_filter ADD filter_id INT NOT NULL ;" but the rest stays open. Admin crashes in many places. I can not find on the screen in what table a field is missing. I am not a programmer.
My problem: how to fresh install 1.7.6.0 and load the backup of a database 1.7.5.2 (or 1.7.5.1)???
I tried to upgrade the database in 1.7.5.2 to 1.5.6.0 but that creates the same errors of course :-) So importing that into a fresh 1.7.6.0 will never work.
I need to put my new site into production soon so my only solution is to ignore 1.7.6.0 and stay at 1.7.5.1 or 1.7.5.2. (forever!). Having created 630 categories, loaded 3800 products, 18000 photo's, setting mega menu settings, bying 7 modules... this is all very frustrating not to be able to upgrade.

The "admin_filter" upgrade was included in 1.7.6.0.sql (by @jolelievre )
https://github.com/PrestaShop/PrestaShop/commit/2be301f710214c7941fba87f3f86c0725ec65173#diff-736be8e15e246a19ed7c0de306412ab4

But @Quetzacoalt91 removed this upgrade from SQL and moved for a new file install-dev/upgrade/php/ps_1760_replace_index_of_admin_filter.php
https://github.com/PrestaShop/PrestaShop/commit/36cd459409b6b7c0927f737432c9267710ba0123#diff-736be8e15e246a19ed7c0de306412ab4 (move to a PHP file)

In this commit remains the "ALTER TABLE" and included ps_1760_replace_index_of_admin_filter() call
https://github.com/PrestaShop/PrestaShop/commit/6806c4de1341439b8e79f4a9b1c1572bdf7c4d2c#diff-736be8e15e246a19ed7c0de306412ab4

Finally, the ALTER TABLE was removed and file ps_1760_replace_index_of_admin_filter deleted:
https://github.com/PrestaShop/PrestaShop/commit/6806c4de1341439b8e79f4a9b1c1572bdf7c4d2c#diff-736be8e15e246a19ed7c0de306412ab4

So I think that @Quetzacoalt91 and @jolelievre should take a revision about this commits

Hi everyone!

First of all indeed the field is missing from the database, sorry about that. But if you need to manually add the missing field you MUST NOT insert an int, filter_id is a string therefore you'd better run

ALTER TABLE `PREFIX_admin_filter` ADD `filter_id` VARCHAR (255) DEFAULT '' NOT NULL AFTER `shop`;

as a quick database fix

Second, a fix has already been managed by @Quetzacoalt91 in https://github.com/PrestaShop/PrestaShop/pull/14620
The actual problem is that this Entity is managed by Doctrine, so we don't need to use custom SQL to update this table as Doctrine is supposed to do it already, but we had a bug with the kernel initialization so this PR should fix the problem

We will perform thorough tests on upgrade before releasing the next 1761 version

ALTER TABLE `PREFIX_admin_filter` ADD `filter_id` VARCHAR (255) DEFAULT '' NOT NULL AFTER `shop`;

as a quick database fix

@jolelievre change the INDEX isn't necessary?

ALTER TABLE `PREFIX_admin_filter`
    ADD `filter_id` VARCHAR (255) DEFAULT '' NOT NULL AFTER `shop`,
    DROP INDEX `admin_filter_search_idx`,
    ADD UNIQUE INDEX `admin_filter_search_id_idx` (`employee`, `shop`, `controller`, `action`, `filter_id`);

probably yes xsbr, without your remark you get an error when you click on Brands and Suppliers in admin, so thank you very much. You fixed this problem for me :-)

Thanks @xsbr I proposed the smallest query possible, but it might have conflicts with Doctrine annotation, if you want to be even more precise you can do

ALTER TABLE `PREFIX_admin_filter` ADD `filter_id` VARCHAR (255) DEFAULT '' NOT NULL AFTER `shop`, DROP INDEX IF EXISTS `admin_filter_search_idx`, DROP INDEX IF EXISTS `search_idx`, ADD UNIQUE INDEX `admin_filter_search_id_idx` (`employee`, `shop`, `controller`, `action`, `filter_id`) ;

@jolelievre unfortunately IF EXISTS isn't available for DROP INDEX on MySQL, so I made this manually

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marionf picture marionf  Â·  3Comments

wikao2 picture wikao2  Â·  3Comments

PrestaShark picture PrestaShark  Â·  3Comments

esistgut picture esistgut  Â·  3Comments

centoasa picture centoasa  Â·  3Comments