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

bug: fetching translated posts by uri #2066

Closed
Tracked by #2366
moonmeister opened this issue Aug 9, 2021 · 2 comments
Closed
Tracked by #2366

bug: fetching translated posts by uri #2066

moonmeister opened this issue Aug 9, 2021 · 2 comments
Labels
Close Candidate Needs confirmation before closing Type: Bug Something isn't working
Milestone

Comments

@moonmeister
Copy link
Collaborator

I'm seeing an issue with Polylang and trying to fetch content by uri. valu-digital/wp-graphql-polylang#57 it's already been reported on the polylang repo but it may be a core issue. If I have 3 pages with the slug "about" but each in a different language, then only the english one is returned (english being the default language). I'm guessing this is a corner case that wasn't considered. Polylang uses the post_link hook to modify urls for rendering.

Can we confirm whether this is a polylang or graphql issue?

Versions

WordPress - 5.8
WPGraphQL - 1.62
Polylang Pro - 3.1-rc1
Polylang WPGraphQL - 0.5.0

@jasonbahl jasonbahl added the Needs: Reproduction This issue needs to be reproduced independently. label Aug 10, 2021
@simplenotezy
Copy link

@moonmeister I can confirm I have the same issue. It seems like Polylang does not respect the "locale/" parameter in the URI.

E.g.

en/about-us --> english page, about us
de/about-us --> english page, about us (should have been the german page)
de/german-about-us --> german page, about us - only if slug is not taken in another language

@justlevine
Copy link
Collaborator

justlevine commented Apr 1, 2022

The issue is indeed with Polylang (tracking: valu-digital/wp-graphql-polylang#35).

Currently, this can be handled by either graphql_pre_resolve_uri or request (h/t @simplenotezy ), but we should keep this (and other extensibility use cases) in mind if/when NodeResolver.php gets refactored.

@justlevine justlevine added Type: Bug Something isn't working Close Candidate Needs confirmation before closing and removed Needs: Reproduction This issue needs to be reproduced independently. labels Apr 1, 2022
@jasonbahl jasonbahl added this to the Node Resolver milestone Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Close Candidate Needs confirmation before closing Type: Bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

4 participants