UPSTREAM FIX

magento2-38447: Special characters in associated product names converted to HTML entities

Community fix magento2-38447 merged into magento/magento2 on 2024-05-16, released in 2.4.8; applies cleanly to 27 releases from 2.4.6 to 2.4.7-p10.

Fixes special characters in associated product names converted to HTML entities edited

Pull request title
Special characters in configurable associate product name are being Converted to HTML Entities.
Pull request
magento/magento2#38447
Issues
#38146 human
Author
@Bansiravaliya7
Merged
2024-05-16
Fixed in
2.4.8
Reported on
2.4.6-p2
Categories
Admin, Catalog/Product
Components
magento/module-configurable-product

Labels

Area
Product
Component
Admin
Priority
P3
Severity
—
Reported on (labels)
2.4.6-p2

Issue

Title and steps come from the upstream issue and pull request.

Description

Special characters in configurable associate product names are being Converted to html entities.

Steps to reproduce

1. Create Configurable Product.
2. Add product name Like Test "config"
3. Create Configuration and Add attribute (color/size) Attributue then select any attribute (color/size) and save the configurable product.
4. Edit the associte product and then observe.

Expected result

Special character in Product Name should be not change to html entities when we edit the associate product.

Actual result

Special characters in configurable associate product names are being Converted to html entities.

### Additional Information (*)
As I have checked When Saving a Configurable Product for the First Time then this file is being called Magento\ConfigurableProduct\Block\Adminhtml\Product\Edit\Tab\Variations\Config\Matrix.php as on line no 377 (Screenshot-3) where escapeHtml is not implemented for name and when second time while editing associated for the same configurable product then this file Magento\ConfigurableProduct\Ui\DataProvider\Product\Form\Modifier\Data\AssociatedProducts.php (Screenshot-4) is being called where on line 308 the escapeHtml method is implemented for the product name.

Screenshot-3
![image](https://github.com/magento/magento2/assets/113010604/338283b4-f90a-40e3-86c8-f80a59970c54)

Screenshot-4
![image](https://github.com/magento/magento2/assets/113010604/e2d403f2-8d56-4a6f-ba2f-de0cf34ee198)

Taken from the upstream issue.

Code match per tag

Each tag was checked with git apply --check against that tag's files. A clean match means the change applies; it is not a test result. Tags that already contain the fix are marked.

LineCode match per tagTests
2.4.6
2.4.6 clean 2.4.6-p1 clean 2.4.6-p2 clean 2.4.6-p3 clean 2.4.6-p4 clean 2.4.6-p5 clean 2.4.6-p6 clean 2.4.6-p7 clean 2.4.6-p8 clean 2.4.6-p9 clean 2.4.6-p10 clean 2.4.6-p11 clean 2.4.6-p12 clean 2.4.6-p13 clean 2.4.6-p14 clean 2.4.6-p15 clean
2.4.6: no test data 2.4.6-p1: no test data 2.4.6-p2: no test data 2.4.6-p3: no test data 2.4.6-p4: no test data 2.4.6-p5: no test data 2.4.6-p6: no test data 2.4.6-p7: no test data 2.4.6-p8: no test data 2.4.6-p9: no test data 2.4.6-p10: no test data 2.4.6-p11: no test data 2.4.6-p12: no test data 2.4.6-p13: no test data 2.4.6-p14: no test data 2.4.6-p15: no test data
2.4.7
2.4.7 clean 2.4.7-p1 clean 2.4.7-p2 clean 2.4.7-p3 clean 2.4.7-p4 clean 2.4.7-p5 clean 2.4.7-p6 clean 2.4.7-p7 clean 2.4.7-p8 clean 2.4.7-p9 clean 2.4.7-p10 clean
2.4.7: no test data 2.4.7-p1: no test data 2.4.7-p2: no test data 2.4.7-p3: no test data 2.4.7-p4: no test data 2.4.7-p5: no test data 2.4.7-p6: no test data 2.4.7-p7: no test data 2.4.7-p8: no test data 2.4.7-p9: no test data 2.4.7-p10: no test data
2.4.8
2.4.8 conflictcontains the fix 2.4.8-p1 conflictcontains the fix 2.4.8-p2 conflictcontains the fix 2.4.8-p3 conflictcontains the fix 2.4.8-p4 conflictcontains the fix 2.4.8-p5 conflictcontains the fix
2.4.8: no test data 2.4.8-p1: no test data 2.4.8-p2: no test data 2.4.8-p3: no test data 2.4.8-p4: no test data 2.4.8-p5: no test data
2.4.9
2.4.9 conflictcontains the fix
2.4.9: no test data

Triage

Model @cf/cloudflare/clef. Probability this is a bug fix: 97.9%. Probability it is security relevant: 91.5%.

Show the model's answers and probabilities
QuestionAnswerProbabilitiesConfidence
Change kindbugfixbugfix 95.2%, refactor 1.6%, tests_only 1.4%, feature 0.8%, dependency 0.6%, docs_only 0.5%88.7%
Areacatalogcatalog 49.8%, admin 44.5%, other 1.5%36.7%
Reported version2.4.6-p22.4.6-p2 62.8%, 2.4.6 3.7%, 2.4.6-p3 1.5%39.0%
Scope0.69 of 20 48.1%, 1 35.1%, 2 16.8%7.4%
Risk0.36 of 20 70.4%, 1 23.3%, 2 6.3%33.1%
Worth backporting1.43 of 22 57.0%, 1 28.9%, 0 14.1%14.2%

Download

For cweagans/composer-patches, choose a version below and download the bundle. Copy its magento2-38447/ folder into patches/composer/, merge composer.patches.json into composer.json, then run composer install. Test files are always removed; paths are relative to each package root, using the default -p1 level.

Packages (1): magento/module-configurable-product
Bundle README (what the ZIP ships)
# magento2-38447

Community fix merged upstream into magento/magento2, adapted by magento.watch.
This is not a patch published by Adobe.

Pull request: https://github.com/magento/magento2/pull/38447
Issue: https://github.com/magento/magento2/issues/38146
Author: @Bansiravaliya7
Source commit: db4f5b142cb28bf657d43d1179ede609c1ccd51c
Modifications: test files and documentation removed, paths rewritten relative to each Composer package.
Licence: OSL-3.0 / AFL-3.0, as the original Magento Open Source code.
Maintainer: Łukasz Bajsarowicz (@lbajsarowicz)

Licence: Magento Open Source code under OSL-3.0 and AFL-3.0. The bundle carries the original author, source commit and the list of modifications.

Sources

Łukasz Bajsarowicz
Built by

Łukasz Bajsarowicz, e-commerce architect

Magento and Adobe Commerce architecture, upgrades, performance and audits for merchants and agencies since 2015; magento.watch is the tooling I use on those projects.

Open source, maintained on weekends.