It is possible to overflow the number of items allowed in Media Library

Created on 6 June 2019, about 5 years ago
Updated 7 July 2023, 12 months ago

Problem/Motivation

When adding new media through the Media Library, it's possible to add more than the allowed number of media items.

Steps to reproduce:
1) In the Media Library, if you can select two items, select two.
2) Now upload a third item.

Expected: You should not be able to select more than the allowed number, or should receive a warning if you do.
Actual: no warning appears, and if you then insert the media you get nothing is attached. It fails without warning.

Proposed resolution

  1. When the number of selected items exceeds the maximum allowed after adding one or more items in the media library, display a warning.
  2. If the user then persists on inserting the media items with an overage, do not allow it, but display an error message.

Video:
https://www.drupal.org/files/issues/2019-12-21/3082690-71-walkthrough_0.mov

Remaining tasks

  • Frontend framework manager review
  • Commit

User interface changes

Added error / warning messages to the media library.

Video of #21: https://www.drupal.org/files/issues/2019-07-17/media-library-exceeds-lim...

The warning after adding and exceeding the limit:
https://www.drupal.org/files/issues/2019-07-17/media-library-add-warning...

The warning after clicking 'Save and select':
https://www.drupal.org/files/issues/2019-07-17/media-library-save-and-se...

The error after clicking 'Save and insert' or 'Insert selected':
https://www.drupal.org/files/issues/2019-07-17/media-library-save-and-in...

API changes

Data model changes

None

Release notes snippet

🐛 Bug report
Status

Fixed

Version

10.1

Component
Media 

Last updated less than a minute ago

Created by

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024