This bug affects sites which have set their default file scheme to something other than public://, but it subtly screws them up in a really hard to notice manner. On line 45 of MediaVimeoStreamWrapper.inc, a hardcoded public:// scheme is used for the path to the locally saved video thumbnail image. This needs to be the Drupal API function file_default_scheme() instead, and I've included a patch for it.
I noticed this problem because my site uses the AmazonS3 module to replace the default file scheme with s3://. This is because we host our site in a load-balanced, multi-server cloud, so we can't let uploaded files sit on one of the server's local file systems, since they'd be inaccessible to the other servers. Oddly enough, this bug doesn't actually break our site's video thumbnails, because of the way it checks for the existence of the thumbnail before serving it. Each time a server manages a request for the thumbnail the first time, it checks it's own local filesystem for the image, discovers that it's not there, and creates it anew. This is an waste of processing time and disk space, which is why I needed to fix the bug. And it's entirely possible that this happy accident that's saving our site won't save a site that's using a different non-default file scheme.
This bug also appears to effect every module that derives a StreamWrapper class from MediaReadOnlyStreamWrapper. I've written a patch for Media: YouTube (#1836926: Thumbnail images are improperly stored) as well, but I don't know which other modules derive from MediaReadOnlyStreamWrapper.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | media_vimeo-use-file_default_sceme-1836942-2.patch | 897 bytes | coredumperror |
| media_vimeo_thumbnail_file_scheme_fix.patch | 700 bytes | coredumperror |
Comments
Comment #1
gmclelland commentedChanging status since a patch is provided
Comment #2
coredumperror commentedThe 2.0 release of Media: Vimeo seems to have reverted this fix. There's a comment claiming that "there's no need to hide thumbnails", apparently explaining why the uri was changed back to a hardcoded "public://".
Please apply the new attached patch (I updated it for 2.0) to change back to using
file_default_scheme(). There are other options besides public:// and private://, sofile_default_scheme()is necessary.Comment #3
hugronaphor commentedI was able to apply patch cleanly and it works as intended.
Comment #4
devin carlson commentedThanks for the patch!
Tested and committed to Media: Vimeo 7.x-2.x.