Problem/Motivation

I'm getting an InvalidArgumentException when trying to render a remote video media through a media reference field. Here's the full error line:

InvalidArgumentException: The internal path component 'https://drupal10.ddev.site/media/oembed' is invalid. Its path component must have a leading slash, e.g. internal:/foo. in Drupal\Core\Url::fromInternalUri() (line 416 of core/lib/Drupal/Core/Url.php).

Steps to reproduce

1. Spin up a fresh Drupal 10 install with the Standard profile
2. Enable Media module
3. Install and enable Media oEmbed Control
4. Add a Media reference field to some content type (Article, for example), and check Remote Video as target
5. Make sure the reference field is using the "Rendered entity" formatter (view mode: default)
6. Make sure the "Video URL" field on Remote Video display settings is using the "oEmbed content" formatter
7. Create a Remote Video media content
8. Create an article content referencing the existing remote video
9. Access the article page

Proposed resolution

It seems the media_oembed_control_preprocess_field() function is expecting an internal path from the oEmbed formatter, but it's getting an absolute URL.

I'm trying to make a patch for this issue.

Remaining tasks

- Fix the InvalidArgumentException

User interface changes

None.

API changes

None.

Data model changes

None.

CommentFileSizeAuthor
#2 remote-video-exception-3388686-1.patch2.12 KBgedvan

Comments

gedvan created an issue. See original summary.

gedvan’s picture

StatusFileSize
new2.12 KB

Here's an initial patch to fix the issue.

I had to fix another issue on the controller due to a change in Symfony's Request class.

matthiasm11’s picture

FYI: the "other issue on the controller due to a change in Symfony's Request class" is being fixed in https://www.drupal.org/project/media_oembed_control/issues/3363412.

danthorne’s picture

Patch is working for me.

acontia’s picture

Patch in #2 worked for me.

  • jacobbell84 committed b2e2b551 on 2.x authored by gedvan
    Issue #3388686 by gedvan, matthiasm11, danthorne, acontia: Exception...
jacobbell84’s picture

Status: Active » Fixed

Thanks all! Did some testing on my side as well and it looks good.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.