Enable media library form displays in Umami

Created on 29 November 2019, over 5 years ago
Updated 14 February 2023, about 2 years ago

Problem/Motivation

When uploading a new image file via the media library widget, the next step of the dialog shows ALL the fields available on that media type.

This differs from Standard profile, where users only see the alt text field.

It's because Umami hasn't enabled the media library form displays, like Standard profile has.

So far the image media type is the only one enabled on media entityreference fields in Umami. The problem does affect the other media types to though, if you enable them for a field. Since we are considering showcasing other media types in Umami, those will need the media library form display too.

Proposed resolution

Enable the media library form displays, like Standard profile does.

  • For image media, hide all fields except field_media_image
  • For all other media types, hide all fields

Remaining tasks

Manual testing using Umami, listing the steps taken.
New before and after screenshots, in the issue summary

Add media library form displays to Umami's install config.

  • DONE - core.entity_form_display.media.audio.media_library.yml
  • DONE - core.entity_form_display.media.document.media_library.yml
  • DONE - core.entity_form_display.media.image.media_library.yml
  • DONE - core.entity_form_display.media.remote_video.media_library.yml
  • DONE - core.entity_form_display.media.video.media_library.yml

User interface changes

Make adding media via the media library widget dialog nicer
Before

After

API changes

None.

Data model changes

None.

๐Ÿ“Œ Task
Status

Fixed

Version

10.1 โœจ

Component
Umamiย  โ†’

Last updated about 1 month ago

  • Maintained by
  • ๐Ÿ‡ฎ๐Ÿ‡ชIreland @markconroy
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom @smaz
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom @kjay
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States @shaal
Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom andrewmacpherson

Live updates comments and jobs are added and updated live.
  • Needs manual testing

    The change/bugfix cannot be fully demonstrated by automated testing, and thus requires manual testing in a variety of environments.

  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

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.

  • ๐Ÿ‡ฎ๐Ÿ‡ชIreland markconroy

    Thanks @Akhil Babu for this testing.

    This looks like it's soooo close to being ready. let's get this final piece implemented to give us parity with Standard profile and then get this merged. Well done everyone, we're nearly there.

  • Status changed to Needs review about 2 years ago
  • ๐Ÿ‡ญ๐Ÿ‡บHungary Zsuffa Dรกvid

    The difference between the grid view of umami and the default profile is caused by the missing "Media library" view mode of the media types.
    Extended patch #12 to include these configs. Attached screenshots of media library grid before/after.

  • Status changed to Needs work about 2 years ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    CI failure in #23

    Added screenshots from #23 to IS.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia _utsavsharma

    Tried to fix CCF for #23.

  • Status changed to Needs review about 2 years ago
  • ๐Ÿ‡ญ๐Ÿ‡บHungary Zsuffa Dรกvid

    Can someone tell me what can cause this test failure? Should I add langcode: true to the hidden section of the yml files, like in core.entity_view_display.media.video.default.yml?

    1) Drupal\Tests\demo_umami\Functional\DemoUmamiProfileTest::testConfig
    Exception: core.entity_view_display.media.audio.media_library: Drupal\Component\Diff\Engine\DiffOpAdd::__set_state(array(
       'type' => 'add',
       'orig' => false,
       'closing' =>
      array (
        0 => '  langcode: true',
      ),
    ))
  • Status changed to Needs work about 2 years ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Can give it a shot. Would see how existing config handles the langcode and update the yml file where needed.

    Will keep this one on my radar so I can review again.

  • Status changed to Needs review about 2 years ago
  • ๐Ÿ‡ญ๐Ÿ‡บHungary Zsuffa Dรกvid

    Ok, I think I find the cause. In the existing config the langcode line was after field_media_document: true line.
    Tests passed in local dev env.

    install config:

    hidden:
      created: true
      langcode: true
      field_media_document: true
    

    existing config:

    hidden:
      created: true
      field_media_document: true
      langcode: true
    

    New patch attached.

  • Status changed to RTBC about 2 years ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Great job figuring that out!

    • lauriii โ†’ committed 4714abf9 on 10.1.x
      Issue #3097503 by andrewmacpherson, Zsuffa Dรกvid, raman.b, Akhil Babu,...
  • Status changed to Fixed about 2 years ago
  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland lauriii Finland

    Committed 4714abf and pushed to 10.1.x. Thanks!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024