InvalidArgumentException: The allowed types parameter is required and must be an array of strings. in Drupal\media_library\MediaLibraryState->validateRequiredParameters() (line 150 of core/modules/media_library/src/MediaLibraryState.php).

Created on 4 July 2024, 10 months ago

Problem/Motivation

"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 150 of core/modules/media_library/src/MediaLibraryState.php)."

Sharing SS:

After Deleting all Media types, I am getting this error on the home page & content page as an admin, except for admin pages...

Steps to reproduce

1. Delete all media types from admin>structure>media.
2. Go back to the home page or any content page.

Proposed resolution

Fix the issue in validateRequiredParameters()

๐Ÿ› Bug report
Status

Active

Version

10.2 โœจ

Component
Mediaย  โ†’

Last updated about 14 hours ago

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia sourav_paul Kolkata

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

Comments & Activities

  • Issue created by @sourav_paul
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sourav_paul Kolkata
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    Fixes are made on on 11.x (our main development branch) first, and are then back ported as needed according to our policies. Also, 10.2 is in security mode now.

  • Does this bug require the sitestudio_page_builder module to reproduce? It is installed on that site. Itโ€™s in the stack trace. But itโ€™s not in the steps to reproduce.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sourav_paul Kolkata

    @cilefen site studio is not required to reproduce the issue....

  • Status changed to Postponed: needs info 10 months ago
  • I can't reproduce this by building a reference site on https://simplytest.me so the steps to reproduce this need refining.

  • Issue was unassigned.
  • Status changed to Active 10 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sourav_paul Kolkata
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sourav_paul Kolkata
  • First commit to issue fork.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vinmayiswamy

    Hi, I followed the steps outlined in the issue summary to reproduce this issue in Drupal 10.2.8-dev (cloned from 10.2.x), using MySQL 5.7 (as MySQL 5.8 is unsupported in DDEV for arm64 architecture. Please see the error below for reference) and PHP 8.3.

    $ ddev config --database=mysql:5.8
    You are reconfiguring the project at /Users/vinmayi.nidubrolu/projects/drupal102x/drupal.
    The existing configuration will be updated and replaced.
    Configuring a 'drupal' project named 'drupal102x' with docroot '' at '/Users/vinmayi.nidubrolu/projects/drupal102x/drupal'.
    For full details use 'ddev describe'.
    failed to validate config: the drupal102x project has an unsupported database type/version: 'mysql:5.8', DDEV arm64 only supports the following database types and versions: mariadb: [10.1 10.2 10.3 10.4 10.5 10.6 10.7 10.8 10.11], mysql: [5.7 8.0], postgres: [9 10 11 12 13 14 15 16]
    

    However, I am not able to reproduce the issue.

    After deleting all media types as described, I revisited the nodes created with the content type that included the media field. The nodes rendered without any issues, and there were no relevant entries in the "Recent log messages."

    Additionally, I checked the same scenario in Drupal 11.x with PHP 8.3 and MariaDB 10.11, and I still couldn't reproduce the issue.

    It seems that this issue may not be reproducible in my current environment. Kindly please let me know if there are any additional steps or configurations that I might have missed that could help in replicating the problem.

    Thanks!

  • Status changed to Postponed: needs info 8 months ago
  • Status changed to Active about 2 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rajeshreeputra Pune

    Steps to reproduce:
    Install site with minimal profile
    Install media_library, ckeditor5, field_ui module
    Visit admin/config/content/formats/add to create new editor.
    Add title New Editor
    Select Text editor as CKEditor5
    Add DrupalMedia in Toolbar as shown in Screenshot.
    Update account settings at admin/config/people/accounts/fields
    click Create a new field
    Select Formatted text
    Add label Bio
    Select Text (formatted, long)
    Click Continue

Production build 0.71.5 2024