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.


    #7 media-do_not_rely_on_allow_url_fopen-1597596-0.patch843 bytesOlarin
    PASSED: [[SimpleTest]]: [MySQL] 0 pass(es). View
    Members fund testing for the Drupal project. Drupal Association Learn more


    astutonet’s picture

    Issue summary: View changes

    corrects the link

    astutonet’s picture

    Nothing to do?

    As the module don't work as desired, priority reassessed.

    astutonet’s picture

    Priority: Major » Critical


    Dave Reid’s picture

    Priority: Critical » Major

    Considering that you're the first to report this, let's settle on major.

    rovo’s picture

    This is happening with me as well.


    Media: YouTube

    rovo’s picture

    If I enter the name of the YouTube user in the Media browser search field, the error goes away.

    Olarin’s picture

    Also 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.

    Olarin’s picture

    Priority: Major » Critical
    Status: Active » Needs review
    843 bytes
    PASSED: [[SimpleTest]]: [MySQL] 0 pass(es). View

    The 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.

    crimsondryad’s picture

    Works for me.

    Devin Carlson’s picture

    Devin Carlson’s picture

    Status: Needs review » Reviewed & tested by the community

    The 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.

    ParisLiakos’s picture

    Status: Reviewed & tested by the community » Fixed

    awesome, i like the proxy part:)

    ParisLiakos’s picture

    Version: 7.x-2.x-dev » 7.x-1.x-dev
    Status: Fixed » Needs review

    Needs backport to 1.x though

    ParisLiakos’s picture

    Status: Needs review » Fixed

    same patch applies on 1.x , commited

    Status: Fixed » Closed (fixed)

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

    Anonymous’s picture

    Issue summary: View changes

    Complete the error message