Cannot add custom type media

Created on 21 January 2020, over 4 years ago
Updated 7 June 2024, 19 days ago

When trying to add some media of custom type (media-types.png) into the main body via Gutenberg media block (gutenberg-media-block.png), the media modal (gutenberg-media-modal.jpg) displays only the "default" media types (audio, file, image etc).

Therefore, all media of custom type cannot be used by Gutenberg Editor.

Can someone help on this?

๐Ÿ› Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

๐Ÿ‡ฉ๐Ÿ‡ชGermany pipicom

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

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • This is still an issue in 8.x-2.8 with remote_video support, it seems like some initial work went into the code but never made it.

  • Status changed to Needs review 8 months ago
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    2 pass
  • ๐Ÿ‡ณ๐Ÿ‡ดNorway mnlund

    Here is a new take on this one, since you still can't use custom media types as for example oembed.

    Instead of defining this and guessing, this patch adds all defined Media types to the dialog in the provided Media block in this module.

  • Great work @mnlund, functionality wise works great.

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    2 pass
  • ๐Ÿ‡ณ๐Ÿ‡ดNorway mnlund

    Re-added support for the existing media types guessing as a fallback.

    The main point with this patch is to gain more control over which Media types, based on the Media types entity definitions, you can use in the Media block and the Media Component. For example if you are using the Media Component in Gutenberg and pass image as allowed type, all Media types supporting images will be allowed. With this patch you get some more fine grained control and can pass the entity IDs for the Media types you want to allow.

    The Media block allows all defined Media types as standard.

  • Would be nice to see if we can get this reviewed and possibly have it re-rolled against 3.x

  • Status changed to Needs work 6 months ago
  • ๐Ÿ‡ณ๐Ÿ‡ดNorway eiriksm Norway

    Can we get a merge request with this, so the pipelines can run the patch? ๐Ÿ˜Ž๏ธ

    Also, this needs tests. If you need some kickstart to get an environment for writing tests, here is a repo that should get you going: https://github.com/frontkom/drupal-contrib-ddev

  • First commit to issue fork.
  • Merge request !112MR of patch #27 by mnlund โ†’ (Open) created by vegardjo
  • ๐Ÿ‡ณ๐Ÿ‡ดNorway vegardjo

    No tests still, but MR of last patch created โ˜๏ธ

  • Pipeline finished with Failed
    4 months ago
    Total: 205s
    #93670
  • I noticed a bug in the patch, if you add any other custom media library (non-core ones), the allowedTypes gets ignored and it will be loaded regardless of what you define

  • Pipeline finished with Failed
    4 months ago
    Total: 1097s
    #112247
  • Pipeline finished with Success
    4 months ago
    Total: 965s
    #112272
  • Pipeline finished with Failed
    4 months ago
    Total: 1042s
    #113173
  • Pipeline finished with Failed
    4 months ago
    Total: 1013s
    #113211
  • Pipeline finished with Success
    4 months ago
    Total: 1155s
    #113341
  • Pipeline finished with Success
    4 months ago
    Total: 935s
    #113368
  • Pipeline finished with Canceled
    4 months ago
    Total: 56s
    #115844
  • Pipeline finished with Failed
    4 months ago
    Total: 1157s
    #115845
  • Pipeline finished with Success
    4 months ago
    Total: 1308s
    #116466
  • Pipeline finished with Success
    4 months ago
    Total: 1166s
    #116643
  • Pipeline finished with Success
    2 months ago
    Total: 277s
    #156503
  • Pipeline finished with Success
    2 months ago
    Total: 211s
    #156514
  • Pipeline finished with Success
    2 months ago
    Total: 180s
    #156521
  • Pipeline finished with Success
    2 months ago
    Total: 274s
    #156534
  • Pipeline finished with Success
    2 months ago
    Total: 245s
    #156552
  • Pipeline finished with Success
    2 months ago
    Total: 190s
    #156594
  • Pipeline finished with Canceled
    2 months ago
    Total: 173s
    #156601
  • Pipeline finished with Success
    2 months ago
    Total: 183s
    #156603
  • Here's a patch against 3.0.x in case anyone needs it

  • Pipeline finished with Failed
    about 2 months ago
    Total: 311s
    #170099
  • Pipeline finished with Success
    about 2 months ago
    Total: 523s
    #170136
  • Pipeline finished with Canceled
    about 1 month ago
    #171679
  • Pipeline finished with Success
    about 1 month ago
    #171683
  • Pipeline finished with Success
    about 1 month ago
    #171714
  • Pipeline finished with Success
    about 1 month ago
    Total: 511s
    #171775
  • Pipeline finished with Success
    about 1 month ago
    Total: 483s
    #171868
  • Pipeline finished with Skipped
    about 1 month ago
    #172227
  • Pipeline finished with Success
    about 1 month ago
    Total: 515s
    #172615
  • ๐Ÿ‡ธ๐Ÿ‡ฆSaudi Arabia martins.bruvelis Thuwal

    martins.bruvelis โ†’ made their first commit to this issueโ€™s fork.

  • Pipeline finished with Success
    19 days ago
    Total: 358s
    #193624
  • Pipeline finished with Canceled
    13 days ago
    Total: 83s
    #197462
  • Pipeline finished with Skipped
    13 days ago
    #197465
Production build 0.69.0 2024