payloadcms / payload

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
https://payloadcms.com
MIT License
24.94k stars 1.59k forks source link

Depth parameter not working with `?locale=all` #4972

Open fsyntax opened 9 months ago

fsyntax commented 9 months ago

Link to reproduction

https://github.com/fsyntax/payload/tree/locale-depth

Describe the Bug

The depth parameter doesnt seem to have any impact when fetching collections with locale=all.

To Reproduce

  1. Create two simple Pages
  2. Create a Hero Block inside one of the pages and add a button in an array field for both locales and link it to the second page
  3. Now visit http://localhost:3000/api/page/1?locale=de&draft=true&depth=1 - heroButtons[0].link.value contains i.e. _status
  4. Then visit http://localhost:3000/api/page/1?locale=all&draft=true&depth=1 - heroButtons.de/en[0].link.value only contains the page ID anymore, regardless of the given depth value

Payload Version

2.9.0

Adapters and Plugins

db-postgres, bundler-webpack

fsyntax commented 8 months ago

Just for references: #2980 and #2987

Davidvision commented 7 months ago

I'm facing the same issue, are there any news on this ?

webmestre-to commented 7 months ago

I am also having this exact issue with relationships not being populate when using locale=all. I must choose between making multiple calls to the database to fill in the missing data or loading each locale individually. Thanks for updating us!

kendelljoseph commented 6 days ago

@fsyntax I wasn't able to reproduce this. Do you still have a repo with an example?