-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Describe the Bug
When using Edit in bulk in the list view, after selecting a field, sunch field doesn't show below to update.
After some digging and some console.logs, it seems if the field has a condition, when selecting the field for bulk edit, this condition is run...
The issue is that in bulk edit the condition is called and the data
parameter receives only one key (the field being edited), with a default value. Then due to the logic of the condition, it returns false and the field is hidden in the bulk edit.
In reality the condition shouldn't even be called in edit bulk cause it's supposed to do logic with data
related to 1 record either in the create, update, or view modes. But in a bulk edit scenario it doesn't make sense since we're trying to edit several records which each should run the condition logic and some may yield true and others false.
Link to the code that reproduces this issue
https://github.com/iofreddy85/payload/tree/edit-bulk-issue
Reproduction Steps
- Run the test environment in the branch code provided in the link of the issue.
- Go to the Products collection.
- Add 2 or more products (you can play with sotck control and add some with and some without)
- Go to the Products ListView, select all the Products and click
Edit
in the Top Right. - Select
Stock Waste
field and see how it doesn't show. - Check console.log on the condition and check how the
data
parameter comes with the field and a default value.
Which area(s) are affected? (Select all that apply)
area: core
Environment Info
Payload: 3.43.0
NodeJs: 22.14.0