Skip to content

[Issue] Fix the product gallery tab when an image attribute label contains a single quote #40519

@m2-assistant

Description

@m2-assistant

This issue is automatically created based on existing pull request: #40517: Fix the product gallery tab when an image attribute label contains a single quote


Description (*)

The data-types attribute in the admin product gallery is delimited using single quotes with @noEscape. When an image attribute label contains a single quote (e.g. Image d'exemple), the attribute is cut off and the gallery breaks.

Fix: use escapeHtmlAttr() with double quotes, consistent with data-images on the line above.

Introduced in 17f0f4d (MAGETWO-99285), where escapeHtml() was replaced with @noEscape instead of escapeHtmlAttr().

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes Images and Videos tab not working #16807

Manual testing scenarios (*)

  1. Create an image attribute with a label containing a single quote (e.g. Image d'exemple)
  2. Assign it to some attribute set
  3. Edit any corresponding product in the admin and open the gallery tab: the gallery is broken

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

Metadata

Metadata

Assignees

Labels

Area: ContentComponent: MediaGalleryIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Reported on 2.4.xIndicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

Type

No type
No fields configured for issues without a type.

Projects

Status
Ready for Development

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions