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.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | remote-video-exception-3388686-1.patch | 2.12 KB | gedvan |
Comments
Comment #2
gedvan commentedHere'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.
Comment #3
matthiasm11 commentedFYI: 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.
Comment #4
danthornePatch is working for me.
Comment #5
acontia commentedPatch in #2 worked for me.
Comment #7
jacobbell84 commentedThanks all! Did some testing on my side as well and it looks good.