Text formats "Embed Media" filter throws error

Created on 17 July 2024, about 2 months ago

Problem/Motivation

Enabling the "Embed Media" filter for the text formats throws an error on the entity page.

Steps to reproduce

  • Go to /admin/config/content/formatsand try to configure any text format
  • Try to configure the "Full HTML" text format /admin/config/content/formats/manage/full_html
  • In the "Toolbar configuration" section from the "Available buttons" drag the "Drupal Media" icon to the "Active Toolbar" and hit "Save configuration"
  • It will show a validation message
    The Drupal media toolbar item requires the Embed media filter to be enabled.
    
  • Now on the same page scroll down to the "Enabled filters" section and enable "Embed media" and hit "Save configuration"
  • Try to add a node that has field with text formats for example Article or Page /node/add/article /node/add/page
  • Error will be thrown
    The website encountered an unexpected error. Try again later.
    InvalidArgumentException: The allowed types parameter is required and must be an array of strings. in Drupal\media_library\MediaLibraryState->validateRequiredParameters() (line 151 of core/modules/media_library/src/MediaLibraryState.php).

Video evidence: https://www.awesomescreenshot.com/video/29619680?key=8d2e4ecc15ce8c65caa...

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
CKEditor 5 

Last updated 2 days ago

Created by

🇮🇳India Prashant.c Dharamshala

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

Comments & Activities

  • Issue created by @Prashant.c
  • 🇮🇳India Prashant.c Dharamshala

    The root cause behind this is when there is no "Media type" defined in the /admin/structure/media but instead of the error in the page, can we handle it on the Text format configuration page itself while saving the configurations with "Embed Media" enabled.

Production build 0.71.5 2024