Skip to content

magento/magento2#40178: Fixed unnecessarily escaped characters in Gra…#40423

Merged
magento-devops-reposync-svc merged 4 commits intomagento:2.4-developfrom
yaroslav-kozar:fix-for-issue-40178
Feb 10, 2026
Merged

magento/magento2#40178: Fixed unnecessarily escaped characters in Gra…#40423
magento-devops-reposync-svc merged 4 commits intomagento:2.4-developfrom
yaroslav-kozar:fix-for-issue-40178

Conversation

@yaroslav-kozar
Copy link
Copy Markdown
Contributor

Description (*)

This PR fixes the issue where GraphQL product name field was unnecessarily escaping special characters using escapeUrl(), which caused breaking changes for native mobile apps and inconsistency with REST API behavior.

Changes made:

  • Removed ProductName resolver that was escaping product names using escapeUrl()
  • Restored default GraphQL behavior where product names are returned raw from the database
  • Removed ProductNameWithSpecialCharactersTest that tested the incorrect escaping behavior
  • Product names with special characters (>, <, ™, ©, etc.) are now returned unescaped as expected
  • Ensures consistency with REST API and Magento's default behavior

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes Unnecessarly escaped charaters in ProductInterface #40178

Manual testing scenarios (*)

  1. Create a product with special characters in the name:

    • SKU: simple>1
    • Name: Simple Product 1 > < & test ♥ ™
  2. Query the product using GraphQL:

    {
      products(filter: { sku: { eq: "simple>1" } }) {
        items {
          sku
          name
        }
      }
    }
  3. Verify the response returns the product name without URL encoding:

    {
      "data": {
        "products": {
          "items": [
            {
              "sku": "simple>1",
              "name": "Simple Product 1 > < & test ♥ ™"
            }
          ]
        }
      }
    }
    image
  4. Compare the result with REST API response (/rest/V1/products/simple>1) - both should return identical unescaped names

  5. Verify that product names display correctly in native mobile applications consuming the GraphQL API

Questions or comments

This change reverts the behavior introduced in a previous update that was causing breaking changes for applications relying on raw product names from GraphQL. The escaping was not only unnecessary but also inconsistent with REST API behavior and Magento's standard data handling.

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)

@m2-assistant
Copy link
Copy Markdown

m2-assistant Bot commented Jan 9, 2026

Hi @yaroslav-kozar. Thank you for your contribution!
Here are some useful tips on how you can test your changes using Magento test environment.
❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names.

Allowed build names are:
  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here
ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.


For more details, review the Code Contributions documentation.
Join Magento Community Engineering Slack and ask your questions in #github channel.

@yaroslav-kozar
Copy link
Copy Markdown
Contributor Author

@magento run all tests

…uct name field

   - Removed ProductName resolver that was escaping product names using escapeUrl()
   - Restored default behavior where GraphQL returns raw product names from database
   - Removed ProductNameWithSpecialCharactersTest that tested incorrect escaping behavior
   - This fix resolves breaking changes for native apps and ensures consistency with REST API
   - Product names with special characters (>, <, ™, ©, etc.) now returned unescaped as expected
@yaroslav-kozar
Copy link
Copy Markdown
Contributor Author

CI Status: Unrelated Failures
The following test failures are not related to my PR changes:

Functional Tests — (Unrelated to my PR)
image

Integration Tests — (Unrelated to my PR)
image

Static Tests — Failing randomly. No reports. (Not related to my PR)

Copy link
Copy Markdown
Contributor

@nuzil nuzil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @yaroslav-kozar
I'm tended to approve this PR. Your changes makes more sense than trying to keep a resolver that escapes/unescapes things.

@engcom-Bravo
Copy link
Copy Markdown
Contributor

@magento run all tests

@engcom-Bravo
Copy link
Copy Markdown
Contributor

Hi @yaroslav-kozar,

Thanks for the collaboration & contribution!

✔️ QA Passed

Preconditions:

  • Install fresh Magento 2.4-develop

Steps to reproduce

  • In Magento admin, create a product with a special character in the name. For example >.
  • Query the name from that product using GraphQL.

Before: ✖️ 

Screenshot 2026-01-27 at 3 22 55 pm

After: ✔️

Screenshot 2026-01-27 at 3 29 09 pm

Builds are failed. Hence, moving this PR to Extended Testing.

Thanks

@engcom-Bravo engcom-Bravo moved this from Testing in Progress to Extended testing (optional) in Community Dashboard Jan 27, 2026
@engcom-Dash engcom-Dash self-assigned this Jan 27, 2026
@engcom-Dash
Copy link
Copy Markdown
Contributor

@magento run all tests

@engcom-Dash
Copy link
Copy Markdown
Contributor

@magento run Functional Tests EE, Functional Tests CE, Functional Tests B2B

@engcom-Dash
Copy link
Copy Markdown
Contributor

The consistent failures in Functional CE, B2B,EE are known issues and JIRA is open for the same. The other failures are inconsistent and flaky. They neither part of the PR nor failing because of the PR changes.

CE
Build 1
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/40423/fd9cc039ea0e5af685c79e60aacec22d/Functional/allure-report-ce/index.html#categories
image

Build 2
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/40423/8faa5356fee1d775f0e5812c88b42539/Functional/allure-report-ce/index.html#categories
image

EE
Build 1
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/40423/d6d768ac434194e2ec30528e4736f0b9/Functional/allure-report-ee/index.html#categories
image

Build 2
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/40423/bbc0e791b97e2a7dd820e0203e559cf4/Functional/allure-report-ee/index.html
image

B2B
Build 1
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/40423/5f4859efe8f38c851e22d572501fdf1b/Functional/allure-report-b2b/index.html#categories/b7007f03643f5636222c64635a0feb74/a5576b8a69e37483/
image

Build 2
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/40423/15da988ed0b2ae6854d32aec7aae4ed5/Functional/allure-report-b2b/index.html#categories/8fb3a91ba5aaf9de24cc8a92edc82b5d
image

Unit Test
AC-16360

Known Issue
AdminCannotAccessStockImagesWithWrongCredentialsTest ACQE-9092

Hence, Moving this PR to Merge In Progress

@engcom-Dash engcom-Dash moved this from Extended testing (optional) to Merge in Progress in Community Dashboard Jan 30, 2026
@magento-devops-reposync-svc magento-devops-reposync-svc merged commit 825834a into magento:2.4-develop Feb 10, 2026
8 of 12 checks passed
@ct-prd-projects-boards-automation ct-prd-projects-boards-automation Bot moved this from Merge in Progress to Recently Merged in Community Dashboard Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Recently Merged

Development

Successfully merging this pull request may close these issues.

Unnecessarly escaped charaters in ProductInterface

7 participants