Describe the bug
When a currency is added in PrestaShop it is impossible to add it a second time, thus it prevent 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
1
Expected behaviour
Rather than adding a new row in database, the previously deleted one should be updated (use the data from the creation form to update its content) AND most importantly its deleted value should be revert back to 0 thus avoiding creating duplicate rows
Additional information
PrestaShop version: N/A
PHP version: N/A
Hi @jolelievre,
Same issue with PS1.7.5.2 & PS1.7.6.1.
Thanks!
@matthieu-rolland @jolelievre what's the status of this issue ?
It's done, but it needs to be rebased I'm on it
Fixed by #16287
ping @matthieu-rolland
This PR : #16287 seems to have corrected the described bug in this issue but another scenario reproduces the error.
Step to reproduce :
Nice catch @SD1982 !!
But since it's another scenario I suggest creating a new issue, something like "Importing a currency from a localization pack duplicates a currency in database when previously deleted"
Indeed this is another feature related to localisation pack so it doesn't use the new handlers used in the dedicated form
ping @khouloudbelguith
Issue created here: https://github.com/PrestaShop/PrestaShop/issues/17661