Skip to content

Follow-up: Apply cardinality limits on file upload earlier #7129

@indigoxela

Description

@indigoxela

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

  1. A file field with cardinality > 1 but < unlimited
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions