Non-admin unable to add oEmbed URL via Media Library widget

Created on 10 September 2024, 2 months ago

Problem/Motivation

In Drupal 10.3.2 or 10.3.3, while authoring a Media field referencing the Remote Video media type with the Media Library widget as a non-administrator, I'm unable to add a URL. This is true for both content types and taxonomy terms.

As an administrator, I can add a URL in this way.

As any role with permission to create Remote Video media, I can add a URL and create a media entity via /media/add/remote_video, then add it via the media library list in the widget. So there is currently a workaround.

In attempting to debug the issue, I noticed that in core/modules/media_library/src/Form/OEmbedForm.php, when I remove the #required attribute for the url field, I am able to select "Add" but the saved entity has an empty URL.

Steps to reproduce

1. Add field to content type or taxonomy:
Entity reference
Reference type: Media
Media type: Remote video (allowed providers: YouTube, Vimeo)

2. While logged in as a non-administrator, author content or taxonomy term. Select "Add media".

3. In the Media Library widget, enter a valid YouTube or Vimeo URL and select "Add".

4. The URL field becomes blank. Error messages related to required field missing value appear (see attached screenshot).

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Postponed: needs info

Version

10.3 ✨

Component
MediaΒ  β†’

Last updated about 6 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States ericblack Lakewood, CO

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

Comments & Activities

  • Issue created by @ericblack
  • Status changed to Postponed: needs info 2 months ago
  • I've read this report and I've not been able to reproduce this bug as written. Here is what I did:

    1. Created a Drupal 10.3.3 site on https://simplytest.me
    2. Installed the Media and Media Library modules.
    3. Added a Media entity reference field to the default "Article" content type.
    4. Added permissions to the default "Content editor" role to manage the Remote video media type.
    5. Created a user with "Content editor" role.
    6. Logged in as the content editor user.
    7. I was able to add a remote video media by URL.

    Since you have a site set up to reproduce the bug we need more information from you on how to trigger the issue.

Production build 0.71.5 2024