magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.54k stars 9.32k forks source link

Swatch attribute option containing double quotes are not correctly displayed #35495

Open ganeddact opened 2 years ago

ganeddact commented 2 years ago

Preconditions and environment

If a product attribute has an option that has a label containing a double quote, it's not being escaped and breaks the templating. In these screens, size should have been "SIZE 14 (35/36") LONG" and instead only "SIZE 14 (35/36" could be read, and inspecting the HTML can be seen how the double quote broke the data-option-label attribute. Screenshot 2022-05-18 at 15 32 54 Screenshot 2022-05-18 at 15 35 08

To make things worse, the template cannot be easily overridden in the theme because it's hardcoded, please refer to https://github.com/magento/magento2/issues/4400 that has been closed without a fix

Steps to reproduce

  1. Set in an attribute (Example: size) a value containing double quote, like 13"
  2. Have that attribute to be displayed as a text swatch
  3. Create a product and some size variants (13", 14", 15", 13" 4', 13" LONG)
  4. The configurable product page will show the text swatch options but the text will be truncated from the ". An inspection of the HTML shows that the "data-option-label" is breaking the HTML because the double quote is not escaped correctly.

Expected result

Swatch options showing the entire label, correctly showing text after the double quote

Actual result

The swatch option label is cut from the double quote onwards

Additional information

No response

Release note

No response

Triage and priority

m2-assistant[bot] commented 2 years ago

Hi @ganeddact. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] commented 2 years ago

Hi @engcom-Delta. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

m2-assistant[bot] commented 2 years ago

Hi @engcom-Lima. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-Lima commented 2 years ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 2 years ago

Hi @engcom-Lima. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 2 years ago

Hi @engcom-Lima, here is your Magento Instance: https://572fb37553ab5551da6e27721bdbedbc.instances.magento-community.engineering Admin access: https://572fb37553ab5551da6e27721bdbedbc.instances.magento-community.engineering/admin_4877 Login: 6dc4201f Password: 29e42fe9aaad

engcom-Lima commented 2 years ago

Verified this issue on 2.4-develop and this issue is reproducible .Hence, confirming the issue. Below is the screenshot :

  1. image

  2. image

  3. image

github-jira-sync-bot commented 2 years ago

Unfortunately, not enough information was provided to create a Jira ticket. Please make sure you added the following label(s): Reproduced on 2.4.x, ^Area:.*

Once all required labels are present, please add Issue: Confirmed label again.

github-jira-sync-bot commented 2 years ago

:white_check_mark: Jira issue https://jira.corp.magento.com/browse/AC-3113 is successfully created for this GitHub issue.

m2-assistant[bot] commented 2 years ago

:white_check_mark: Confirmed by @engcom-Lima. Thank you for verifying the issue.
Issue Available: @engcom-Lima, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

m2-assistant[bot] commented 2 years ago

Hi @engcom-Lima. Thank you for working on this issue. Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:


engcom-Delta commented 3 weeks ago

Hi @ganeddact ,

Thanks for your reporting and collaboration. We have re-verified the issue in latest 2.4-develop instance and the issue is reproducible. Kindly refer the screenshots.

Steps to reproduce -

  1. Set in an attribute (Example: size) a value containing double quote, like 13"
  2. Have that attribute to be displayed as a text swatch
  3. Create a product and some size variants (13", 14", 15", 13" 4', 13" LONG)
  4. The configurable product page will show the text swatch options but the text will be truncated from the ". An inspection of the HTML shows that the "data-option-label" is breaking the HTML because the double quote is not escaped correctly. image image image
  5. Observe ,The swatch option label is cut from the double quote onwards Thanks.