Typeerror when adding an oembed media with core patches from #2916730

Created on 24 February 2025, 16 days ago

Problem/Motivation

Applying the core patches linked in https://www.drupal.org/node/2916730 results in an error when adding an oembed media through the media library:

TypeError: Drupal\Core\Entity\Entity\EntityFormDisplay::collectRenderDisplay(): Argument #1 ($entity) must be of type Drupal\Core\Entity\FieldableEntityInterface, Drupal\Core\Form\FormState given, called in /var/www/html/app/core/modules/media_library/src/Form/AddFormBase.php on line 248 in Drupal\Core\Entity\Entity\EntityFormDisplay::collectRenderDisplay() (line 85 of core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php). 

Steps to reproduce

  • Add an oembed media type
  • Apply core patches mentioned in 2916730
  • Try to add oembed media through media library

Proposed resolution

Call getFormDisplay with the entity if in the media_library_add_form_oembed form too.

🐛 Bug report
Status

Active

Version

2.2

Component

Code

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

Comments & Activities

Production build 0.71.5 2024