Prestashop: Weird behaviour when filling the quantity field with letters of symbols

Created on 6 Mar 2020  路  9Comments  路  Source: PrestaShop/PrestaShop

On order page > Add a product, when performing this action, you can still save it and this will add a fake product with zero quantity. It will removed when reloading the page.

1.7.7.x Bug Fixed Minor Order PM 鉁旓笍 PR available Regression migration

Most helpful comment

Indeed, my bad I used the wrong word. I did mean "quantity". I'm changing it in the title / desc for clarification ;)
This is related to #17968 but this is a new issue to be added to this EPIC, as the problem is not that you try to edit the quantity with 0, but try to edit the quantity field with letters or symbols.

All 9 comments

Related to #17968

I don't understand this one, what is this "stock field" you mention? If it's the "quantity" field then what is the difference with issue #17968 ?

@jolelievre , yes you are right. it is the quantity field (didn't read your comment before pushing PR :) )

OK, I wait for a confirmation rom @colinegin But if the problem comes from quantity, then this issue is a duplicate And a PR has already been proposed that fixes the validation server side rather than on front which is more robust regarding our domain rules

@jolelievre I totally agree with you that we should never rely on front-end validation alone. Server-side first. Really thank you for your PR because I was struggling to find where to modify server side and now I am learning from your code).

Indeed, my bad I used the wrong word. I did mean "quantity". I'm changing it in the title / desc for clarification ;)
This is related to #17968 but this is a new issue to be added to this EPIC, as the problem is not that you try to edit the quantity with 0, but try to edit the quantity field with letters or symbols.

Ok, but it's actually the same problem of validation of data, so it's already been managed in this PR https://github.com/PrestaShop/PrestaShop/pull/18168

Amazing 馃拑

Fixed by #18200

Was this page helpful?
0 / 5 - 0 ratings