Error with required fields when adding media via Drupal Media Library Browser Widget

Created on 23 July 2024, 7 months ago

Problem/Motivation

Adding new media (of a custom Media type) via media/add works just fine. However when adding via the Media Gallery modal (Media Library Widget), it initially only shows the Media Source Field and none of the other user-created custom fields (e.g. text, poster image, etc.).

Normally, (e.g. for core Remote Video) there should be "next step" with the remaining fields and a message displayed that says "The media item has been created but has not yet been saved. Fill in any required fields and save to add it to the media library." (see core/modules/media_library/src/Form/AddFormBase.php).

However this does not happen. Instead an Error message is displayed that says "This value should not be null." and there is no option to fill in the required fields.

Steps to reproduce

Add a new Media type that uses Remote Media URL as the media source.
Add other fields and make one of them required.
Try to add a new entity of the Media type using the Media Library Widget (e.g. on a Paragraphs entity reference field).

Perhaps this is a Feature Request, but the form (MediaRemoteMediaForm.php) should be updated to handle other (required) fields that the media type may have.

πŸ› Bug report
Status

Active

Version

1.8

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States uri_frazier Portland, Oregon

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

Comments & Activities

Production build 0.71.5 2024