Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We discovered an incompatibility with the CDN module https://drupal.org/project/cdn resulting in an "Unexpected Error" when trying to embed a YouTube video.
With the CDN module, this is due to
file_create_url()
in
sites/all/modules/contrib/media_youtube/includes/MediaInternetYouTubeHandler.inc
public function getOEmbed()
generating the invalid URL:
/oembed?url=http%3A//<CLOUDFRONTID>.cloudfront.net/http%3A//www.youtube.com/watch%3Fv%3<YOUTUBEVIDEO>&format=json
Instead of the correct URL generated with
drupal_realpath()
:
http://www.youtube.com/oembed?url=http%3A//www.youtube.com/watch%3Fv%3<YOUTUBEVIDEO>&format=json
A one line patch is included.
NOTE: https://drupal.org/project/media_vimeo also uses drupal_realpath() in the corresponding place in the code.
Comment | File | Size | Author |
---|---|---|---|
#1 | media_youtube-use-drupal-realpath-instead-of-file-create-url-2200997-1.patch | 655 bytes | andrewhine |
Comments
Comment #1
andrewhine CreditAttribution: andrewhine commentedPatch attached.
Comment #2
andrewhine CreditAttribution: andrewhine commented