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.
Hi!
I'm testing this module with Media: YouTube.
I'm getting the following errors when I try to add a YouTube link:
- http://youtu.be/myurl-aMs could not be added. Only the following types of files are allowed to be uploaded: image
- Warning: simplexml_load_file() [function.simplexml-load-file]: URL file-access is disabled in the server configuration in _media_retrieve_xml() (line 38 of /home/my_site/public_html/sites/all/modules/media/includes/media.xml.inc).
- Warning: simplexml_load_file(https://gdata.youtube.com/feeds/api/videos?q=&max-results=12&start-index...) [function.simplexml-load-file]: failed to open stream: no suitable wrapper could be found in _media_retrieve_xml() (line 38 of /home/my_site/public_html/sites/all/modules/media/includes/media.xml.inc).
I can't add the link...
Searching for related issues, I found this, with FB Social Plugin Integration.
Maybe, we can uses the same solution.
Tks.
Comment | File | Size | Author |
---|---|---|---|
#7 | media-do_not_rely_on_allow_url_fopen-1597596-0.patch | 843 bytes | Olarin |
Comments
Comment #0.0
astutonetcorrects the link
Comment #1
astutonetNothing to do?
As the module don't work as desired, priority reassessed.
Comment #2
astutonetTks
Comment #3
Dave ReidConsidering that you're the first to report this, let's settle on major.
Comment #4
rovoThis is happening with me as well.
Media
7.x-2.0-unstable5+1-dev
Media: YouTube
7.x-2.0-alpha2
Comment #5
rovoIf I enter the name of the YouTube user in the Media browser search field, the error goes away.
Comment #6
Olarin CreditAttribution: Olarin commentedAlso seeing this issue, with Media: Youtube 2.0-alpha2 and Media 2.0-unstable6.
To be clear, for me this comes up at the top of the media browser modal whenever I'm trying to add a Media file in CKEditor (even if I haven't clicked to the Web or Youtube tabs yet), and doesn't go away no matter what I'm doing in that modal. And unsurprisingly, the "search" in the Youtube tab never gets any results.
Comment #7
Olarin CreditAttribution: Olarin commentedThe problem is that calling simplexml_load_file on a remote file requires allow_url_fopen to be enabled in PHP configuration. Many people are going to have this disabled for good reason so relying on it is inadvisable. Patch attached to replace that line with a drupal_http_request followed by a simplexml_load_string.
Comment #8
crimsondryad CreditAttribution: crimsondryad commentedWorks for me.
Comment #9
Devin Carlson CreditAttribution: Devin Carlson commentedMarked #1772418: MEdia fails to import video behind proxy as a duplicate.
Comment #10
Devin Carlson CreditAttribution: Devin Carlson commentedThe patch in #7 applied cleanly and successfully allowed Media to retrieve information over HTTP in an environment where
allow_url_fopen
is disabled.This change also allows Media to retrieve information through a firewall (useful for corporate users) since #7881: Add support to drupal_http_request() for proxy servers (http not https) has been committed.
Comment #11
ParisLiakos CreditAttribution: ParisLiakos commentedawesome, i like the proxy part:)
commited
Comment #12
ParisLiakos CreditAttribution: ParisLiakos commentedNeeds backport to 1.x though
Comment #13
ParisLiakos CreditAttribution: ParisLiakos commentedsame patch applies on 1.x , commited
Comment #14.0
(not verified) CreditAttribution: commentedComplete the error message