Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

Bug in pscleaner free module #63

Open
hanicab opened this issue May 20, 2019 · 1 comment
Open

Bug in pscleaner free module #63

hanicab opened this issue May 20, 2019 · 1 comment

Comments

@hanicab
Copy link

hanicab commented May 20, 2019

Describe the bug
When we click 'repair database' bouton, the module empties the table 'stock_mvt' and delete all existing columns in this table.

To Reproduce
Steps to reproduce the behavior:

  1. Add or edit a stock for some products ( to create some stock movments history )
  2. Go to pscleaner module
  3. Click on 'repair database'
  4. go to phpmyadmin and check the table 'stock_mvt'
  5. You will see that the table has become empty

Cause of problem:
I think because in prestashop 1.7.5.0 the table stock is always empty , so when the module try to compare id_stock in the both tables , it will delete all columns of the table 'stock_mvt'

Additionnal information
PrestaShop version: 1.7.5.0
PHP version: 7.2

@khouloudbelguith
Copy link

Hi @hanicab,

Thanks for your report.
I manage to reproduce the issue with PS1.7.6.0beta1 / PS1.7.5.2 & the pscleaner v2.0.0.
When we click on Check & fix for the "FUNCTIONAL INTEGRITY CONSTRAINTS" section, the ps_stock_mvt will be empty & we have like a green alert

The following queries successfully fixed broken data:
DELETE FROM `ps_product_attribute_image` WHERE `id_image` NOT IN (SELECT `id_image` FROM `ps_image`)
4 line(s)
DELETE FROM `ps_stock_mvt` WHERE `id_stock` NOT IN (SELECT `id_stock` FROM `ps_stock`)
4 line(s)

I’ll add this to the debug roadmap so that it’s fixed. If you have already fixed it on your end or if you think you can do it, please do send us a pull request!
Thanks!

@PierreRambaud PierreRambaud transferred this issue from PrestaShop/PrestaShop Feb 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants