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
We are filtering a relationship field using filterOptions with data, that is added to a document in an afterRead/beforeRead hook. Sometimes the data argument is passed with the enriched property, sometimes it is not. That results in the field entries not being filtered correctly. In my reproduction I also couldn't save the entry when the undefined filter removed all options from the field.
Describe the Bug
We are filtering a relationship field using filterOptions with data, that is added to a document in an afterRead/beforeRead hook. Sometimes the data argument is passed with the enriched property, sometimes it is not. That results in the field entries not being filtered correctly. In my reproduction I also couldn't save the entry when the undefined filter removed all options from the field.
Link to the code that reproduces this issue
https://github.com/mzronek/payload-bug-filter
Reproduction Steps
Steps:
Result: Only shows a single user, although both should be shown.
Console shows: DATA FILTER undefined
To test beforeRead, comment afterRead hook, uncomment beforeRead hook in Test.ts.
Which area(s) are affected? (Select all that apply)
area: core
Environment Info
The text was updated successfully, but these errors were encountered: