Closed
Description
Preconditions (*)
- Vagrant box, Debian 9
- Magento 2.2.9
- Chrome 78
- Create a virtual product with Customizable Options:
- Option Title: Message
- Option Type: Area
- Max Characters: 20
- Don't forget to add a price and stock
Steps to reproduce (*)
- Try to put this product in your basket with a message 'Is twenty characters' => OK on front and can add to cart.
- Try to put this product in your basket with a message with a newline:
'Is
twenty
characters'
=> Ok on front, but error on adding to cart: 'The text is too long.'
Expected result (*)
- If the Javascript validator validates the input, it should be valid on server-side as well.
Actual result (*)
- Error shown although the Javascript validator passed.
Summary
The Javascript validator counts newlines as a single character (\n).
On the server side (\Magento\Catalog\Model\Product\Option\Type\maxCharacters) newlines are counted as 2 characters (\r\n).
Metadata
Metadata
Assignees
Labels
The issue has been fixed in 2.4-develop branchGate 2 Passed. Manual verification of the issue description passedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Passed. Automatic verification of issue format passedGate 4. Acknowledged. Issue is added to backlog and ready for developmentThe issue has been reproduced on latest 2.4-develop branch