Skip to content
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

ProductUrlSuffix and CategoryUrlSuffix GraphQL resolvers fail with null values #30909

Closed
1 of 5 tasks
aligent-lturner opened this issue Nov 12, 2020 · 7 comments · Fixed by #30910
Closed
1 of 5 tasks
Assignees
Labels
Component: GraphQL GraphQL Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: ready for confirmation Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: done Reported on 2.4.x Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S2 Major restrictions or short-term circumventions are required until a fix is available.

Comments

@aligent-lturner
Copy link
Contributor

aligent-lturner commented Nov 12, 2020

Preconditions (*)

  1. Magento version 2.4.x
  2. Magento 2.4-develop

Steps to reproduce (*)

  1. Go to Admin -> Stores -> Configuration -> Catalog -> Catalog -> Search Engine Optimization
  2. Clear product and category url suffix values in admin and save

Screenshot from 2020-11-20 15-24-20

Run GraphQL query that requests product and/or category url suffix value

{
  categoryList {
    url_suffix
  }
}

Expected result: Empty string ('') is returned for url_suffix value

Screenshot from 2020-11-20 15-40-01

Actual Result: ✖️ Query fails

Screenshot from 2020-11-20 15-29-15

✖️ with the following error in exception.log:

2020-11-20 13:29:04] main.ERROR: Return value of Magento\CatalogUrlRewriteGraphQl\Model\Resolver\CategoryUrlSuffix::getCategoryUrlSuffix() must be of the type string, null returned {"exception":"[object] (GraphQL\\Error\\Error(code: 0): Return value of Magento\\CatalogUrlRewriteGraphQl\\Model\\Resolver\\CategoryUrlSuffix::getCategoryUrlSuffix() must be of the type string, null returned at /var/www/html/magento24/vendor/webonyx/graphql-php/src/Error/Error.php:174, TypeError(code: 0): Return value of Magento\\CatalogUrlRewriteGraphQl\\Model\\Resolver\\CategoryUrlSuffix::getCategoryUrlSuffix() must be of the type string, null returned at /var/www/html/magento24/app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/CategoryUrlSuffix.php:80)"} []

Additional Information

The problem is that the private functions getProductUrlSuffix and getCategoryUrlSuffix are declared with string as the return type, but when values are cleared in admin config, null gets stored in the core_config_data table. The value being returned by ScopeConfigInterface->getValue should be checked for null and changed to empty string instead.
I will create PR to fix this.


Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
@m2-assistant
Copy link

m2-assistant bot commented Nov 12, 2020

Hi @aligent-lturner. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

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:

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

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

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

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

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

@m2-community-project m2-community-project bot added this to Ready for Confirmation in Issue Confirmation and Triage Board Nov 12, 2020
@engcom-Delta engcom-Delta added Reported on 2.4.x Indicates original Magento version for the Issue report. Component: GraphQL GraphQL labels Nov 13, 2020
@sidolov sidolov added Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. labels Nov 13, 2020
@m2-community-project m2-community-project bot added this to Pull Request In Progress in High Priority Backlog Nov 13, 2020
@m2-community-project m2-community-project bot removed this from Ready for Confirmation in Issue Confirmation and Triage Board Nov 13, 2020
@engcom-Alfa engcom-Alfa added Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Nov 20, 2020
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @engcom-Alfa
Thank you for verifying the issue. Based on the provided information internal tickets MC-39290 were created

Issue Available: @engcom-Alfa, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@m2-community-project m2-community-project bot moved this from Pull Request In Progress to Ready for Development in High Priority Backlog Nov 20, 2020
@m2-community-project m2-community-project bot moved this from Pull Request In Progress to Ready for Development in High Priority Backlog Nov 20, 2020
@zakdma
Copy link
Contributor

zakdma commented Nov 25, 2020

@magento i am working on it

@m2-community-project m2-community-project bot moved this from Ready for Development to Pull Request In Progress in High Priority Backlog Nov 25, 2020
@m2-community-project m2-community-project bot moved this from Pull Request In Progress to Ready for Development in High Priority Backlog Nov 25, 2020
@m2-community-project m2-community-project bot moved this from Pull Request In Progress to Ready for Development in High Priority Backlog Nov 25, 2020
@m2-community-project m2-community-project bot moved this from Ready for Development to Dev In Progress in High Priority Backlog Nov 25, 2020
@m2-community-project m2-community-project bot moved this from Ready for Development to Dev In Progress in High Priority Backlog Nov 25, 2020
@aligent-lturner
Copy link
Contributor Author

@zakdma there is already an approved PR for this issue.

@zakdma
Copy link
Contributor

zakdma commented Nov 25, 2020

@aligent-lturner ok
Please assign it to issue

@zakdma zakdma removed their assignment Nov 25, 2020
@m2-community-project m2-community-project bot moved this from Dev In Progress to Pull Request In Progress in High Priority Backlog Nov 25, 2020
@aligent-lturner
Copy link
Contributor Author

@zakdma it was referenced - for some reason the bot removed the pr in progress tag.
#30910

@magento-engcom-team magento-engcom-team added the Fixed in 2.4.x The issue has been fixed in 2.4-develop branch label Dec 10, 2020
@magento-engcom-team
Copy link
Contributor

Hi @aligent-lturner. Thank you for your report.
The issue has been fixed in #30910 by @aligent-lturner in 2.4-develop branch
Related commit(s):

The fix will be available with the upcoming 2.4.3 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: GraphQL GraphQL Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: ready for confirmation Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: done Reported on 2.4.x Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S2 Major restrictions or short-term circumventions are required until a fix is available.
Projects
7 participants