-
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
ProductUrlSuffix and CategoryUrlSuffix GraphQL resolvers fail with null values #30909
Comments
Hi @aligent-lturner. 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. Please, add a comment to assign the issue:
🕙 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 |
✅ Confirmed by @engcom-Alfa 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. |
@magento i am working on it |
@zakdma there is already an approved PR for this issue. |
@aligent-lturner ok |
Hi @aligent-lturner. Thank you for your report.
The fix will be available with the upcoming 2.4.3 release. |
Preconditions (*)
Steps to reproduce (*)
Run GraphQL query that requests product and/or category url suffix value
Expected result: Empty string (
''
) is returned forurl_suffix
valueActual Result: ✖️ Query fails
✖️ 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
andgetCategoryUrlSuffix
are declared withstring
as the return type, but when values are cleared in admin config,null
gets stored in thecore_config_data
table. The value being returned byScopeConfigInterface->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.
The text was updated successfully, but these errors were encountered: