Prestashop: Creating a once deleted currency causes duplicate rows in database

Created on 13 Feb 2020  路  6Comments  路  Source: PrestaShop/PrestaShop

Describe the bug
When a currency is added in PrestaShop it is impossible to add it a second time, thus it prevents having duplicate
However, if you delete a currency and then add it again a new row is inserted and the former one is still present with its deleted column set to 1 (soft delete)
This means the database has duplicated rows, and that different orders with the same currency do not use the same one in database
To Reproduce
Steps to reproduce the behavior:

  1. Go to Internationalisation > Localization > Currencies
  2. Add a new currency (for example USD)
  3. Go back to the currencies list and delete the newly created currency
  4. Download the "added and deleted" curreny localization pack, for example, United Stets pack
  5. A second row in the database is created

Screenshots
image

Additional information
PrestaShop version: 1.7, 1.7.7.x
PHP version: 7.1

1.7.5.2 1.7.6.3 1.7.7.x BO Bug Currencies Fixed Minor PR available

All 6 comments

Ping @matthieu-rolland
Related to https://github.com/PrestaShop/PrestaShop/pull/16287

Is this a regression ? Should it be fixed for 177 ?

Hi @colinegin,

No, it is not a regression.
Same issue with PS1.7.5.2 & PS1.7.6.3
image
image

In fact, this issue is not totally fixed.

Thanks!

@khouloudbelguith I think this one is not only related but seems like a duplicate of https://github.com/PrestaShop/PrestaShop/issues/15934
Which has been fixed by this PR in 1.7.7 https://github.com/PrestaShop/PrestaShop/pull/16287/files

Hi @jolelievre,

No, this issue is not fixed in the PS1.7.7.
I can reproduce the issue with 177x branch
https://drive.google.com/file/d/132ouko0vHbDeP1ro0KL902C0-DRS-86X/view?usp=sharing
Following these steps

  1. Go to Internationalisation > Localization > Currencies
  2. Add a new currency (for example USD)
  3. Go back to the currencies list and delete the newly created currency
  4. Download the "added and deleted" curreny localization pack, for example, United Stets pack
  5. A second row in the database is created

Thanks!

Oh my bad! I didn't understand it was added via the localization pack
Thank you @khouloudbelguith

Was this page helpful?
0 / 5 - 0 ratings

Related issues

khouloudbelguith picture khouloudbelguith  路  3Comments

centoasa picture centoasa  路  3Comments

matks picture matks  路  3Comments

Fabuloops picture Fabuloops  路  3Comments

wikao2 picture wikao2  路  3Comments