Restore the name field on media entities

Created on 22 November 2024, 4 months ago

Problem/Motivation

Currently, the name field is hidden in favour of the filename. The filename may bear no relation at all to the contents of the image. One issue caused is with accessibility, because it is sometimes not possible to retrieve image media without seeing the image itself. Editors need to be able to name their media and edit the name later so that finding the media amongst many entities is possible.

Steps to reproduce

Visit the media library, add some image media. Observe only the filename is available.

Proposed resolution

Restore the name field.

πŸ“Œ Task
Status

Active

Component

Track: Media Management

Created by

πŸ‡¬πŸ‡§United Kingdom tonypaulbarker Leeds

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @tonypaulbarker
  • πŸ‡¬πŸ‡§United Kingdom tonypaulbarker Leeds

    Will tackle this once the main media management implementation code is shipped https://www.drupal.org/project/drupal_cms/issues/3487391 πŸ“Œ Implementation of the initial Media Management Proposal Active

  • πŸ‡¦πŸ‡ΊAustralia pameeela

    This is a tricky one. In theory I have no issue with exposing the name field on the full form, but I am opposed to exposing it in the media library field. I agree that in some cases it's handy to modify, but that is certainly less common. Since it's required and isn't auto-filled if it's exposed, I don't think that's a good tradeoff -- it effectively doubles the workload for every image upload.

    But then it's a little strange, that sometimes you have to provide a name (if you are creating it independently) and sometimes you don't. I guess that is still a happy medium between forcing it to always be set, and auto-setting it and never being able to change it.

  • πŸ‡¬πŸ‡§United Kingdom tonypaulbarker Leeds

    @pameeela this goes beyond the scope of this particular issue, but I think a great rule of thumb would be to make it pain free to add media whilst editors are working on their node content (requiring minimal input like alt text for images) and for the full form / edit screen to be the place to add more rich metadata. For SEO and categorisation it's envisaged to have a few more fields on media entities in the future, but only the minimum required because during discovery people told us they don't want lots of fields to manage. We could provide some additional views for people to see an overview of how complete that data is without making the library interface itself difficult to work with.

    So following those principles I think your suggestion is perfect for both the short term and the long term aims.

  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    πŸ“Œ Implementation of the initial Media Management Proposal Active was committed so this is unblocked. Reassigning to @tonypaulbarker.

  • πŸ‡¬πŸ‡§United Kingdom tonypaulbarker Leeds

    This one would be nice to work out in time to include in the release, tagging as such.

  • πŸ‡¦πŸ‡ΊAustralia pameeela
  • πŸ‡¦πŸ‡ΊAustralia pameeela

    pameeela β†’ changed the visibility of the branch 3489120-media to hidden.

  • πŸ‡¦πŸ‡ΊAustralia pameeela

    OK, so I was completely wrong about how this works -- I am living in the past!

    It still fills in the name field automatically, even if it's exposed. It just shows it to you as editable. So I'm totally in favour of adding it to all of the media form modes, including the media library one.

    But I don't have the bandwidth to actually make this change, it's a bit fiddly with adding all of the config files for the ones where we are using core recipes.

  • πŸ‡¦πŸ‡ΊAustralia pameeela

    Only took me one day to forget why this is a pain: because the media types are added in various different ways, including from core recipes, so overriding the config is tricky. Not sure we will get this done.

  • πŸ‡¦πŸ‡ΊAustralia pameeela

    Created a core issue to make this change directly in the core recipes, which makes a lot more sense! We'll just need to update the SVG type here.

  • Merge request !406Resolve #3489120 "Media name" β†’ (Merged) created by pameeela
  • Pipeline finished with Success
    2 months ago
    Total: 956s
    #390415
  • πŸ‡¦πŸ‡ΊAustralia pameeela

    Changed it for SVG, not sure if we should wait to merge this until there's a decision on the core change one way or another.

  • πŸ‡¦πŸ‡ΊAustralia pameeela
  • πŸ‡¦πŸ‡ΊAustralia pameeela

    @tonypaulbarker reminded me we could do this with config actions, for some reason I just thought this wasn't doable, but I've updated that now. Needs testing cuz it's fiddly and it's also late in the day, and the week :|

  • Pipeline finished with Success
    2 months ago
    Total: 805s
    #390675
  • πŸ‡¬πŸ‡§United Kingdom tonypaulbarker Leeds

    This seems to work well.

    The name field is present for document, remote video, image and svg image.

    After uploading a file through featured image field or the CKEditor media widget, the name field auto-populates with the filename and is editable.

    Marking RTBC.

  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • Pipeline finished with Skipped
    2 months ago
    #390785
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    Merged into 1.x and cherry-picked to 1.0.x. Thanks!

  • Status changed to Fixed about 2 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024