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

Nested Docs URL conflicts when using same slug with different parents #5879

Open
truthseekers opened this issue Apr 16, 2024 · 4 comments
Open
Assignees
Labels
[possible-bug] Possible bug which hasn't been reproduced yet

Comments

@truthseekers
Copy link

Link to reproduction

No response

Describe the Bug

I am allowed to use the same slug with different parents, but the front end does not pull the correct page when following your nested-docs examples. Creating these parent-child relationships causes problems:

/service-one/
/service-one/location-one
/service-two/
/service-two/location-one

Visiting localhost:3001/service-two/location-one displays the /service-one/location-one page.

To Reproduce

Follow these steps to setup payload: https://github.com/payloadcms/payload/tree/main/examples/nested-docs/payload

Follow these steps to setup next with app router: https://github.com/payloadcms/payload/tree/main/examples/nested-docs/next-app

Create parent and child pages with same slug but different parents to experience problem. Example:

/plumbing/
/plumbing/dallas/
/roofing/
/roofing/dallas

And The app will not pull the correct page when trying to visit /roofing/dallas or /plumbing/dallas

Payload Version

"latest" (says 2.4 in node_modules)

Adapters and Plugins

No response

@truthseekers truthseekers added the [possible-bug] Possible bug which hasn't been reproduced yet label Apr 16, 2024
@sarfarazsiddiquii
Copy link

can i work on this issue?

@truthseekers
Copy link
Author

can i work on this issue?

If you are talking to me then absolutely. I don't see why the owner would mind either.

@DanRibbens
Copy link
Contributor

I assigned you @sarfarazsiddiquii so we don't duplicate efforts on our end.

Thanks for offerring you help!

@sarfarazsiddiquii
Copy link

@DanRibbens , I've submitted a pull request that addresses this issue.
I'd appreciate your feedback and any suggestions for improvement.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[possible-bug] Possible bug which hasn't been reproduced yet
Projects
None yet
Development

No branches or pull requests

3 participants