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

Comments

ericblack created an issue. See original summary.

cilefen’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: -Widget Media library, -oembed +Needs steps to reproduce

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.

wilsotoa’s picture

StatusFileSize
new3.29 MB

Hello cilefen, in my case I get the same error but it is due to the honeypot module, because when rendering the modal I get repeated several times the field 'url' and when I assign the permission Bypass Honeypot protection, to my user who has the basic permissions of content editor then if the form works correctly, I share video.

quietone’s picture

Version: 10.3.x-dev » 11.x-dev

Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies.

smustgrave’s picture

Wanted to bump 1 more time before closing.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

bbrala’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Been a while. Guess no issue anymore.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.