The return value from the function DrupalStorageStreamWrapper::getExternalUrl shold be a web accessible URL, according to the documentation here. It currently only returns the Drupal path instead. This results in URLs to files looking like this:

http://system/storage/serve/4/filename.jpg

I am using Drupal 7.8 and Storage API 7.x-1.2. This should be a small fix, and I will supply a patch shortly.

Files: 
CommentFileSizeAuthor
#1 external_url.patch353 bytesmwallenberg

Comments

mwallenberg’s picture

Status:Active» Needs review
StatusFileSize
new353 bytes

Only a small fix is needed, in storage_core_bridge.module, line 620. The following diff shows the difference:

@@ -617,7 +617,7 @@
       }

      
-      return $storage->serveURL();
+      return $storage->serveURL(TRUE);
     }
     catch (StorageException $e) {
       return FALSE;

I've made an attempt at a patch file, though I don't think it can be applied directly. As I said, it's a small change - just supply TRUE as the argument to serveUrl.

jbrown’s picture

Assigned:mwallenberg» Unassigned
Status:Needs review» Fixed

Thanks, but this is already fixed in 7.x-1.2: http://drupalcode.org/project/storage_api.git/commitdiff/58a6f62

mwallenberg’s picture

*facepalm*

Indeed it is. I'll just update my 7.x-1.1 version to 7.x-1.2, and I'll be fine. :P

Status:Fixed» Closed (fixed)

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