- First commit to issue fork.
- Merge request !7993Issue #3185321: Only set a default name for the media item if mapped in the media source → (Open) created by odensc
A generated name for media entities is not alway a good idea, especially for document media types, where a descriptive and searchable title would be better.
Between the media entity form and the media modal upload widget , there is an inconsistency between how the media name basefield is applied, when the field is not hidden from the form.
In #2882473: Hide the media name basefield from the entity form by default → it was stated that "Probably 80% of the use cases will want this populated automatically".
For images, I agree this is probably true. But in the case of documents, some installations will want to provide a descriptive and searchable media name. Both for use on the frontend and also in the media library.
The inconsistency arrises because the media modal upload widget pre-populates the name field with a generated value and this can result in media being named inappropriately.
Upload some media.
1. Directly via the path /media/add/document
2. Via a media enabled content type using the media library modal.
1. In the case of the default form mode from the media module.
- On creating a new document, an empty (and required) input is provided.
- The content creator has to provide a name before the form can be saved.
2. The media modal upload widget behaves differently.
- On creating a new document, the name field is pre-populated with a generated name, as would happen if the field was hidden.
- The content creator does not have to provide an alternative before saving the form.
---
In the
original feature request →
it was suggested that "if the name basefield is visible on the entity form, it should be entered by a human and should not be pre-populated.
However, during the Drupal Usability Meeting - 2020-12-04 it was concluded that such an approach would be unsuitable and may cause problems for existing sites. See comment 15. →
Only set a default name for the media item if mapped in the media source.
1. Agree that a worthwhile UX improvement could be implemented.
2. Develop a patch.
When the Media type does not provide a mapping for the media's name, the Name field has to be filled out manually.
Needs work
11.0 🔥
Last updated
Makes Drupal easier to use. Preferred over UX, D7UX, etc.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.