Change record status: 
Project: 
Introduced in branch: 
8.7.x
Introduced in version: 
8.7.0
Description: 

Previously, the media library field widget would display two buttons for most users: "Browse media" and "Add media". The former opens a modal view allowing users to select media items to reference in the field, and the latter would open a small form allowing users to upload new files into their media library.

As part of implementing the new media library designs in #3019150: Update/improve mockups and designs for the media library, the "Add media" button has now been removed. Once #3020716: Add vertical tabs style menu to media library and #3023802: Show media add form directly on media type tab in media library are committed to Drupal core, the widget will only display an "Add media" button, which will open a modal containing both the media library view, and the small form allowing users to upload new files.

Impact on code extending the widget

If someone was extending the widget, the formElement() method no longer returns a media_library_add_button sub-element. If they were relying on that specific element, it is no longer going to be there.

This change necessitated the removal of the protected $addAccess property from Drupal\media_library\Plugin\Field\FieldWidget/MediaLibraryWidget. In the new media library design, permission to add new media items is computed while rendering the contents of the modal window, and is not something that the widget plugin needs to know about. Rather than deprecate the $addAccess property, it was completely removed in order to make things clearer (since it's part of a dead code path) and to prevent the possibility of bugs or accidental security holes (i.e., access bypass) caused by it being incorrectly evaluated as TRUE when it should be FALSE, or vice-versa.

Impacts: 
Site builders, administrators, editors
Module developers
Themers
Distribution developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done