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

wpgraphql when the slug is persian give me null result #2847

Closed
1 of 3 tasks
AliNaraghiA opened this issue Jul 9, 2023 · 5 comments · Fixed by #2851
Closed
1 of 3 tasks

wpgraphql when the slug is persian give me null result #2847

AliNaraghiA opened this issue Jul 9, 2023 · 5 comments · Fixed by #2851

Comments

@AliNaraghiA
Copy link

Description

I am sure i have a post with slug:سلام/this is works with English and number only .
query POST_WITH_SLUG1 {
postBy(slug: "سلام") {
postId
id
databaseId
title
slug
}
}

{
"data": {
"postBy": null
},
"extensions": {
"debug": [
{
"type": "DEBUG_LOGS_INACTIVE",
"message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."
}
]
}
}

Steps to reproduce

  1. find post with correct slug

Additional context

No response

WPGraphQL Version

last

WordPress Version

last

PHP Version

7.4

Additional enviornment details

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have disabled ALL plugins except for WPGraphQL.

  • Yes
  • My issue is with compatibility with a specific WordPress plugin, and I have listed all my installed plugins (and version info) above.
@AliNaraghiA
Copy link
Author

also i fixed: support UTF-8 encoding

@jasonbahl
Copy link
Collaborator

@AliNaraghiA is this a valid issue still or did you fix it? I'm not sure based on your last comment.

@AliNaraghiA
Copy link
Author

AliNaraghiA commented Jul 11, 2023

@jasonbahl No, I still have a problem. I can't call the post with the slug:

query PostBySlugEn($slug: ID!) {
post(id: $slug, idType: SLUG) {
title
content
postId
featuredImage {
node {
sourceUrl
altText
}
}
}
}


QUERY VARIABLES:
{
"slug": "سلام"
}


{
"data": {
"post": null
},

But I have a post with {slug: سلام} in WordPress posts.

@AliNaraghiA
Copy link
Author

ALSO i can see slug : with this code 👍
#2804 (comment)
{
"data": {
"posts": {
"nodes": [
{
"title": "فارسی",
"slug": "فارسی",
"id": "cG9zdDo0Mzg="
},

@jasonbahl
Copy link
Collaborator

jasonbahl commented Jul 11, 2023

@AliNaraghiA I opened a PR that resolves this. Would love if you could confirm the fix for your use cases 🙏🏻

jasonbahl added a commit that referenced this issue Jul 12, 2023
…de-slugs

fix: querying posts by slug or uri when the post name is non-ascii
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants