[Admin][improvement] Do not allow HTML tags for product attribute options when type is dropdown or multiple select#27417
Conversation
|
Hi @vasilii-b. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
|
@magento run all tests |
1280b66 to
ee6a8c8
Compare
And solve minor conflicts on the MFTF action groups
|
@magento run all tests |
|
Hi @vasilii-b. Considering the fact that the only static tests were executed we can assume that Magento cannot be installed after the change you've provided (theoretically). I would recommend doing the following for confirming this assumption.
|
|
Hi @rogyar, |
|
@magento create issue |
| /** | ||
| * Validation pattern for attribute options HTML tags | ||
| */ | ||
| const VALIDATION_HTML_TAGS_RULE_PATTERN = '/<[^<]+>/'; |
There was a problem hiding this comment.
Please, make const private
| /** | ||
| * Validation message for attribute options with HTML tags | ||
| */ | ||
| const VALIDATION_HTML_TAGS_RULE_MESSAGE = 'HTML tags are not allowed for the attribute options. '. |
There was a problem hiding this comment.
Please, make const private
sidolov
left a comment
There was a problem hiding this comment.
Please, take a look at the review comments
…for-dropdown-options # Conflicts: # app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Attribute/ValidateTest.php
…t attribute options when type is dropdown or multiple select.
|
@magento run all tests |
3 similar comments
|
@magento run all tests |
|
@magento run all tests |
|
@magento run all tests |
…t attribute options when type is dropdown or multiple select - installation fix.
|
@magento run all tests |
…for-dropdown-options
|
@magento run all tests |
…for-dropdown-options
|
@magento run all tests |
Before changes ✔️I can create dropdown product attribute with:
And option value with Html tags which visible on PDP After changes ✖️I try to create the same attribute and get the following error @vasilii-b could you please take a look? |
|
Hi @vasilii-b, I'm closing this PR now due to inactivity. |
|
Hi @vasilii-b, thank you for your contribution! |


Description (*)
This PR aims to add a new validation for the options of the product attribute type "Dropdown", "Multiple Select" that checks whenever the option value contains HTML tags.
HTML tags are not useful nor displayed on the storefront for the product attribute options, those the store manager should be aware of it.
Related Pull Requests
#27371
Fixed Issues (if relevant)
N/A
Manual testing scenarios (*)
<span>,</strong>, etc.Questions or comments
Are the provided Unit and MFTF tests enough or there should be done more?
Contribution checklist (*)
Resolved issues: