-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom attributes of images generated by Block\Product\ImageFactory don't render correctly #25219
Comments
Hi @chris-pook. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. @chris-pook do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
Hi @engcom-Charlie. Thank you for working on this issue.
|
Hello @chris-pook Please use So i have to close this issue. |
Fair enough. Thanks. |
This still seems to be an issue with ImageFactory. The same template vendor/magento/module-catalog/view/frontend/templates/product/image_with_borders.phtml will render the image and this is where the escaping issue is happening. |
@chris-pook could you update the description of issue and add new steps? |
We are closing this issue due to inactivity. If you'd like to update it, please reopen the issue. |
Updated description and description to reflect use of ImageFactory to replicate this issue. |
@chris-pook Thank you for contribution and collaboration! |
✅ Confirmed by @engcom-Charlie Issue Available: @engcom-Charlie, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
Hi @chris-pook. Thank you for your report.
The fix will be available with the upcoming 2.4.0 release. |
(i) This ticket is created automatically based on a verified GitHub issue.
{panel}
If you are starting to work on this Jira ticket, please notify issue reporter and authors of related community pull requests (if any) that you are going to work on this issue:
{panel}
When using the core product image factory it is no longer possible to add your own custom attributes to the markup produced, due to incorrect escaping of the html output.
######Preconditions
######Steps to reproduce (*)
######Expected result
The image html should render with each of the custom attribute values returned by getCustomAttributes() escaped. In this example
<img data-sku="<sku>" />
.######Actual result (*)
The image renders with the entire getCustomAttributes() string escaped meaning the html is invalid and the attribute is not available on the html element. In this example
<img  data-sku="<sku>" />
.This stems from an over zealous use of escapeHtmlAttr() here: f40f24c#diff-eed94ca7983b385a07b8fb5ee2dbc20d
The text was updated successfully, but these errors were encountered: