Closed (fixed)
Project:
Drupal core
Version:
10.1.x-dev
Component:
media system
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Sep 2022 at 13:10 UTC
Updated:
22 Sep 2023 at 05:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
rajeshreeputraComment #3
rajeshreeputraComment #4
rajeshreeputraComment #5
rajeshreeputraComment #9
heni_deepak commented@Rajeshreeputra
can we use it without NextJs work dependency? I think NextJs is out of Drupal core.
Comment #10
cilefen commentedComment #11
rajeshreeputra@heni_deepak, You can reproduce this with headless Drupal with different domains(DNS).
Drupal as backend on dns1.com and different frontend with dns2.com.
Now create article or any other content type node with embedded video and visit your frontend site you will see the 404 for embedded video iframe section.
Comment #12
wim leersIsn't this just a bug in the decoupled application? It's the responsibility of any decoupled application to transform relative URLs?
Comment #13
trevorkjorlien commentedComment #14
internetter commentedIf somebody only needs the change to absolute oembed path. We made only this change, see patch attached.
Comment #16
skyredwang> Isn't this just a bug in the decoupled application? It's the responsibility of any decoupled application to transform relative URLs?
No, I think this is at least a DX issue. When CKeditor is used to embed a remote media, the
iframeis embedded in the body of a long text. For most front end applications, sure, they can add a domain to the URL that output by Media OEmbed, but that means the front end needs to parse the body of the text.For few frontend apps, multiple Drupal backends can be connected at the same time, therefore, the frontend would have a little bit more logic to write when prefixing a domain.
Proposed solution: And a checkbox somewhere to allow Media OEmbed to output absolute URLs when checked, and default to relative path for backward compatibility
Comment #17
skyredwangComment #18
fjgarlin commentedI could reproduce this situation when testing Drupal in a subdirectory (ie:https://localhost/subdirectory).
We are trying to convert DrupalCI to GitlabCI in this issue: #3375827: Investigate tests failures
One of the errors we were getting was in "MediaSourceOEmbedVideoTest"
* Job: https://git.drupalcode.org/project/gitlab_ci_testbed_for_drupal_core/-/j...
* Error: ElementNotFoundException: Element matching css "iframe.media-oembed-content" not found.
Upon investigation, this was due to having "/subdirectory/media/oembed?..." in the src attribute (note the starting "/"), but when prepending the base path, then "https://localhost/subdirectory/subdirectory/media/oembed?..." doesn't exist.
The fix:
* Pretty much the same as #14 (setting the value of the URL to absolute).
* See the second change here: https://git.drupalcode.org/project/gitlab_ci_testbed_for_drupal_core/-/c...
* Job: https://git.drupalcode.org/project/gitlab_ci_testbed_for_drupal_core/-/j... . See how the "MediaSourceOEmbedVideoTest" is gone.
I think #14 is the cleaner and easier solution, with no UI changes needed, but the suggested MR would also solve the issue.
Comment #19
fjgarlin commentedSee my previous comment for further context as this seems to be an issue as well in installations running in a subdirectory.
I've going to set this issue as "Need review" with the suggested fix in #14.
Comment #20
smustgrave commentedBelieve the issue summary should be updated if the solution for #14 is the path forward. Will also needed test coverage.
Comment #21
catchThis is blocking gitlab CI.
Comment #22
fjgarlin commentedUpdated slightly the issue description to match the suggested fix.
Comment #23
catchGiven this fails on gitlab ci that will be plenty of implicit test coverage so happy to add explicit coverage in a follow-up.
Comment #24
smustgrave commentedOpened #3384881: Add tests for oembed iframe absolute
Comment #26
catchCommitted 05e455e and pushed to 11.x. Thanks!
Comment #28
quietone commentedThe issue summary was updated a bit in #22