Problem: When I try to use the auto-generated Breadcrumb URL, the server returns a 404.
Setup:
npx create-payload-appwith PostgreSQL- Default seed
- Add
poststo nestedDocsPlugin collections - Setup a parent -> child -> grandchild relationship between existing
posts
Observed Behavior: The Breadcrumbs field automatically generates what appears to be the correct url, i.e. /<parent>/<child>/<grandchild> when looking at the post that is the grandchild. Using that URL results in a 404. Using just the /<grandchild> segment loads the grandchild post.
Attempted Fixes: I have tried going into src/app/(frontend)/posts/[slug]/page.tsx and change the where property of the payload.find function call inside the queryPostBySlug function to also check to see if a breadcrumb with a URL like the slug exists. However, this section of code is never hit when trying to use one of the nested Breadcrumb URLs.
**Potential Next Step?: ** My next thought is that I might need to change how a post auto-generates its slug? But wouldn't that also change how the Breadcrumb generates its URLs and break that part? I'm kinda lost at what to do next.