Issue: when I try to embed a vimeo video into the media browser, I get the following error:
"https://vimeo.com/81819608 could not be added. Only the following types of files are allowed to be uploaded: audio, document, image, video"

I have media_vimeo installed at the latest version (7.x-2.0) and Media at the latest version (7.x-2.1). I have media_youtube installed as well, and youtube videos do upload.

The media player is enabled for vimeo...(Enter a URL to a file or media resource. Many media providers also support identifying media via the embed code used to embed the media into external websites.
Supported internet media providers: YouTube, Vimeo.)

Below is a screenshot of media browser with error message:

Comments

lauriekap created an issue. See original summary.

hawkeye217’s picture

Seeing the same thing but on media_vimeo 7.x-2.x-dev and Media 7.x-2.6.

hawkeye217’s picture

Actually, nevermind - my issue was config related. Not sure if the OP is still having an issue though.

joseph.olstad’s picture

Category: Bug report » Support request
Status: Active » Needs review

Curious, so what was your configuration solution?

joseph.olstad’s picture

Status: Needs review » Postponed (maintainer needs more info)
nwehner’s picture

I'm having this same problem since upgrading to Media 7.x-2.10. Haven't yet found a configuration solution for it.

After pasting in a Vimeo URL and clicking the _next_ button I get: "https://vimeo.com/88819008 could not be added. Only the following types of files are allowed to be uploaded: video"

Any ideas on a workaround?

nwehner’s picture

Figured it out! Turns out the Media: Vimeo module doesn't respect "allowed file types" correctly in the field settings. I initially had the types restricted to allow only Video. I couldn't use Vimeo videos with that setting. However, unchecking all "allowed file types" (thus enabling the default to allow all types) allows Vimeo videos to be used.

sherkajon’s picture

#7 worked for me. Thank you nwehner!

joseph.olstad’s picture

Title: Unable to upload/embedding vimeos in media browser » allow video files should include web files like vimeo and youtube
Project: Media: Vimeo » D7 Media
Version: 7.x-2.1 » 7.x-2.11
Category: Support request » Bug report
Status: Postponed (maintainer needs more info) » Needs work

hmm, sounds like a bit of a bug with the allowed file types functionality. allow video files should include web files like vimeo and youtube or at least allow choosing to allow those instead of bypassing all the allowed types by unchecking all of them.
bump this over to the media queue.

thanks for reporting.

joseph.olstad’s picture

Title: allow video files should include web files like vimeo and youtube » allowed types, video files should include web files like vimeo and youtube
cboyden’s picture

This problem also happens with other types of files, not just video. If you have a field configured to only allow Document and Image, and you use the Web tab to input the URL of an image, you'll see the same error message.

However, if you have "Bypass file access control" turned on for the logged-in user, you don't get the message. You are able to successfully upload the image.

joseph.olstad’s picture

ok, thanks, I don't have time to fix this right now, but if you or someone else can that'd be great. I'll review the fix asap.

cboyden’s picture

Further info, this problem doesn't happen when you go to /file/add/web, only when you try to use the web tab in the Media browser.

cboyden’s picture

I've been through this with a debugger and the only thing I can pin down is that file_entity_access() expects a filename string instead of a file object for the "create" op. But the media internet uploader passes in a null file object instead. The result of this is that the cache ID that controls access rights is set to a different value on each of two consecutive passes through the file_entity_access() function. (For existing files, the cache ID is the same on both passes through the function.) So new files fail the access check.

joseph.olstad’s picture

Is there a parameter we need to add to the whitelist for the file object? See media.module , there is a whitelist there. Maybe good to check this whitelist? It is used by I believe the media browser popup

cboyden’s picture

I've been digging into the code some more, and I can't tell if the problem is in Media or File Entity.

The commit that breaks this is in File Entity: http://cgit.drupalcode.org/file_entity/commit/?id=27c1b77947d5ee69c1d388...

There are several problems with that update, I'm going to file a related issue on File Entity and see if fixing them also solves this problem.

cboyden’s picture

Version: 7.x-2.11 » 7.x-2.x-dev
Status: Needs work » Needs review
joseph.olstad’s picture

The patch mentioned above has been committed to file_entity 7.x-2.x dev and 7.x-3.x dev.
if you experience this problem, upgrade to the 7.x-2.x dev version of file_entity OR file_entity 7.x-2.11 (has not yet been released)

Thanks to cboyden for the fix.

cboyden’s picture

Status: Needs review » Active

Unfortunately the patch in #2916585: Wrong file property used on file_entity_access doesn't fix this issue.

cboyden’s picture

Project: D7 Media » File Entity (fieldable files)
Status: Active » Needs review

Moving this to file_entity.

The problem is in file_entity_file_entity_access. The hook should check for the Create operation first. Media doesn't set the is_new property on the file - and as far as I can tell, neither does file_entity or any core module - so new files will always fail the check that's currently running first.

cboyden’s picture

StatusFileSize
new1.05 KB

Patch is attached.

  • cboyden authored 39c4d14 on 7.x-2.x
    Issue #2874781 by cboyden, lauriekap: allowed types, video files should...

  • cboyden authored 39c4d14 on 7.x-3.x
    Issue #2874781 by cboyden, lauriekap: allowed types, video files should...
joseph.olstad’s picture

Status: Needs review » Fixed

looks good, committed , thanks again!

Status: Fixed » Closed (fixed)

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