Description of the bug
This is a follow-up to #7119 which only fixed the error, but not the base problem. It's possible to upload more files than allowed, they're only wiped out on node (entity) save.
It might be a bit tricky to get available items count at that point of the process, but let's explore...
Steps To Reproduce
- A file field with cardinality > 1 but < unlimited
- Upload a bunch of files in one go, more than the field cardinality would allow
Actual behavior
See them all attached to the field values in the form (they get wiped out on node save).
I don't think, the UX is ideal.
Expected behavior
Some magic, that no more than $cardinality are attached - possibly uploaded?
Additional information
- Backdrop CMS version: 1.34
Multi-upload came into core with #440
Description of the bug
This is a follow-up to #7119 which only fixed the error, but not the base problem. It's possible to upload more files than allowed, they're only wiped out on node (entity) save.
It might be a bit tricky to get available items count at that point of the process, but let's explore...
Steps To Reproduce
Actual behavior
See them all attached to the field values in the form (they get wiped out on node save).
I don't think, the UX is ideal.
Expected behavior
Some magic, that no more than $cardinality are attached - possibly uploaded?
Additional information
Multi-upload came into core with #440