payloadcms/payload

defaultDepth: 0 breaks folder browser

Closed this issue · 4 comments

Describe the Bug

If you set defaultDepth: 0 and then enter a folder in the folder browser, subfolders now show with name undefined and clicking them goes back to the root.

Image

I assume some request that depends on depth is missing the depth setting.

EDIT: Furthermore, created at and updated at columns are missing data if defaultPopulate is applied to the folders collection that does not include those fields. If these fields are required, they should be explicitly asked for in the query.

Link to the code that reproduces this issue

(sorry guys but last time I built a project with Payload - back then V2 - I reported so many bugs, if I also had to create a separate project for each it would have cost me my whole day... it's too high a barrier to reporting bugs for me, I am afraid! Instead, I try to point out where the issue is, if I can see that. I do this for you, after all... for myself I always just add a workaround, I can't wait for fixes anyway!)

Reproduction Steps

Create a new project, configure folders, set defaultDepth: 0 in the config. Then browse into a folder.

Which area(s) are affected? (Select all that apply)

area: ui

Environment Info

Binaries:
  Node: 20.19.5
  npm: 10.8.2
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  payload: 3.56.0
  next: 15.4.4
  @payloadcms/db-mongodb: 3.56.0
  @payloadcms/email-nodemailer: 3.56.0
  @payloadcms/graphql: 3.56.0
  @payloadcms/next/utilities: 3.56.0
  @payloadcms/richtext-lexical: 3.56.0
  @payloadcms/translations: 3.56.0
  @payloadcms/ui/shared: 3.56.0
  react: 19.1.0
  react-dom: 19.1.0
Operating System:
  Platform: linux
  Arch: x64
  Version: #5794-Microsoft Mon Apr 07 17:55:00 PST 2025
  Available memory (MB): 32767
  Available CPU cores: 10

@CherryDT I can reproduce this if you allow me?

I still don't understand what you mean with those questions. If you want to work on an issue, just do it, or perhaps ask the maintainers (but I'm sure PRs are welcome), why ask me?

🚀 This is included in version v3.57.0

This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.