You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey @elliott-w — this is by design, as by default, hidden fields are completely omitted before afterChange hooks are run. They would appear if you had run a local API update or create with showHiddenFields: true, but because the REST API and GraphQL APIs do not have a way to expose hidden fields, they will indeed be hidden in lots of cases.
If you would like to have your hidden field return from APIs and be visible in afterChange hooks, but hide them only in the admin UI, you could use admin.hidden or admin.disabled instead. Either of these options would make them surface in the afterChange hook but stay hidden in the admin UI.
Describe the Bug
See title
Link to the code that reproduces this issue
https://github.com/elliott-w/payload
Reproduction Steps
Add the following field to any collection:
In the repro, I've added this to the posts collection.
When you create a post you would expect
true
to be printed in console, but you getfalse
Change
hidden
property tofalse
and now you gettrue
printed in console.Which area(s) are affected? (Select all that apply)
area: core
Environment Info
Binaries:
Node: 20.16.0
npm: 10.8.1
Yarn: N/A
pnpm: 9.12.2
Relevant Packages:
payload: 3.0.0-beta.124
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:04 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6020
Available memory (MB): 16384
Available CPU cores: 10
The text was updated successfully, but these errors were encountered: