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
- When the number of selected items exceeds the maximum allowed after adding one or more items in the media library, display a warning.
- 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
Discuss solutionWrite patchUX ReviewA11Y Review- Code review
- 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