Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Db fields after migration from 1.7.5.0 to 1.7.6.1 #15720

Closed
SharmPRO opened this issue Sep 26, 2019 · 6 comments
Closed

Missing Db fields after migration from 1.7.5.0 to 1.7.6.1 #15720

SharmPRO opened this issue Sep 26, 2019 · 6 comments

Comments

@SharmPRO
Copy link

@SharmPRO SharmPRO commented Sep 26, 2019

missing fields in table:
filter_id in ps_admin_filter
position in ps_lang
position in ps_manifacturer

Any idea?

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

@khouloudbelguith khouloudbelguith commented Sep 30, 2019

Hi @SharmPRO,

By default, same with PS1.7.5 & PS1.7.6, the position doesn't exist in ps_lang & ps_manufacturer tables
image
image
About the ps_admin_filter table, I did not manage to reproduce the issue after upgrade from PS1.7.5.2 to PS1.7.6.1, the filter_id is not missing.
Can you please provide us the log of your upgrade? It can be found in the log.txt file, available in <admin folder>/autoupgrade/tmp/log.txt

Thanks!

@SharmPRO

This comment has been minimized.

Copy link
Author

@SharmPRO SharmPRO commented Oct 1, 2019

here the log...
Also ps_currency was missing precision and iso_code values
log.txt

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

@khouloudbelguith khouloudbelguith commented Oct 2, 2019

@SharmPRO, as you can see in your log file.
The upgrade is not successfully completed.
The upgrade of the database is not fully migrated.

[2019-09-26 09:43:21] [INTERNAL] /web/htdocs/www.cosmetolando.it/home/testaruba/gescosmo14/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 /web/htdocs/www.cosmetolando.it/home/testaruba/modules/autoupgrade/classes/UpgradeTools/CoreUpgrader/CoreUpgrader.php(372): call_user_func_array('ps_1760_copy_da...', Array)
#2 /web/htdocs/www.cosmetolando.it/home/testaruba/modules/autoupgrade/classes/UpgradeTools/CoreUpgrader/CoreUpgrader.php(340): PrestaShop\Module\AutoUpgrade\UpgradeTools\CoreUpgrader\CoreUpgrader->runPhpQuery('1.7.6.0', '/* PHP:ps_1760_...')
#3 /web/htdocs/www.cosmetolando.it/home/testaruba/modules/autoupgrade/classes/UpgradeTools/CoreUpgrader/CoreUpgrader.php(264): PrestaShop\Module\AutoUpgrade\UpgradeTools\CoreUpgrader\CoreUpgrader->runQuery('1.7.6.0', '/* PHP:ps_1760_...')
#4 /web/htdocs/www.cosmetolando.it/home/testaruba/modules/autoupgrade/classes/UpgradeTools/CoreUpgrader/CoreUpgrader17.php(52): PrestaShop\Module\AutoUpgrade\UpgradeTools\CoreUpgrader\CoreUpgrader->upgradeDb('1.7.5.0')
#5 /web/htdocs/www.cosmetolando.it/home/testaruba/modules/autoupgrade/classes/UpgradeTools/CoreUpgrader/CoreUpgrader.php(81): PrestaShop\Module\AutoUpgrade\UpgradeTools\CoreUpgrader\CoreUpgrader17->upgradeDb('1.7.5.0')
#6 /web/htdocs/www.cosmetolando.it/home/testaruba/modules/autoupgrade/classes/TaskRunner/Upgrade/UpgradeDb.php(41): PrestaShop\Module\AutoUpgrade\UpgradeTools\CoreUpgrader\CoreUpgrader->doUpgrade()
#7 /web/htdocs/www.cosmetolando.it/home/testaruba/gescosmo14/autoupgrade/ajax-upgradetab.php(52): PrestaShop\Module\AutoUpgrade\TaskRunner\Upgrade\UpgradeDb->run()
#8 {main}

It looks like something went wrong with your update and don't have some of the database columns that were added for 1.7.6.1
The solution is to add the missing columns to your database schema.
You can find the full schema for 1.7.6.1 here:
https://github.com/PrestaShop/PrestaShop/blob/1.7.6.1/install-dev/data/db_structure.sql

Thanks to check & feedback

@ediathome

This comment has been minimized.

Copy link

@ediathome ediathome commented Oct 13, 2019

I am experiencing the same issue. The db_structure.sql is of no help, as the error is related to the ps_admin_filter table and this one is not touched in the 1.7.6.1 sql file! I haven't researched too deeply but I think this may be an error in the code, and instead of 'filter_id' the field 'id' should be selected. Here is the symphony error stack:

Doctrine\DBAL\Exception\InvalidFieldNameException:
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, "ProductController", "catalogAction"]:

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

  at vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:71
  at Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('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, &quot;ProductController&quot;, &quot;catalogAction&quot;]:SQLSTATE[42S22]: Column not found: 1054 Unknown column \'t0.filter_id\' in \'field list\'', object(PDOException))
     (vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:128)
  at Doctrine\DBAL\DBALException::driverExceptionDuringQuery(object(Driver), object(PDOException), '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', array(1, 1, 'ProductController', 'catalogAction'))
     (vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:855)
  at Doctrine\DBAL\Connection->executeQuery('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', array(1, 1, 'ProductController', 'catalogAction'), array('integer', 'integer', 'string', 'string'))
     (vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php:712)
  at Doctrine\ORM\Persisters\Entity\BasicEntityPersister->load(array('employee' => 1, 'shop' => 1, 'controller' => 'ProductController', 'action' => 'catalogAction'), null, null, array(), null, 1, null)
     (vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php:196)
  at Doctrine\ORM\EntityRepository->findOneBy(array('employee' => 1, 'shop' => 1, 'controller' => 'ProductController', 'action' => 'catalogAction'))
     (src/Adapter/Product/AdminProductDataProvider.php:96)
  at PrestaShop\PrestaShop\Adapter\Product\AdminProductDataProvider->getPersistedFilterParameters()
     (src/PrestaShopBundle/Controller/Admin/ProductController.php:129)
  at PrestaShopBundle\Controller\Admin\ProductController->catalogAction(object(Request), 'last', 0, 'last', 'last')
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, false)
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:200)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request), 1, false)
     (admin123/index.php:86)
@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

@khouloudbelguith khouloudbelguith commented Oct 14, 2019

@ediathome, this issue is fixed with PS1.7.6.1.
Here's the PR: #14620, it fixed this issue: #14617 & here's a provisional solution:

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

Thanks!

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

@khouloudbelguith khouloudbelguith commented Nov 11, 2019

Hi @SharmPRO,

Since we had no news from you for more than 30 days, I'll close this ticket. Feel free to open another one if you can give specific details.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.