Closed (won't fix)
Project:
ImageCache
Version:
6.x-2.0-beta9
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 May 2009 at 10:44 UTC
Updated:
25 May 2012 at 03:39 UTC
Hi, I have the following case : the "files" directory is outside of my drupal installation.
in this case the function file_directory_path() return something like "/mydir".
so the menu_router item of imagecache can never be called because all path received by drupal won't begin with a '/'
I suggest the following fix in imagecache.module :
replace
$items[file_directory_path().'/imagecache'] = array(
'page callback' => 'imagecache_cache',
'access callback' => TRUE,
'type' => MENU_CALLBACK
);
with
$image_cache_router_path = file_directory_path().'/imagecache';
//we check if the path is an absolute path (ie outside of the drupal base directory)
$external_file_system = (strpos(file_directory_path(), '/') === 0);
if($external_file_system){
$image_cache_router_path = substr(file_directory_path(),1, strlen(file_directory_path())) .'/imagecache';
}
$items[$image_cache_router_path] = array(
'page callback' => 'imagecache_cache',
'access callback' => TRUE,
'type' => MENU_CALLBACK
);
Regards,
David
Comments
Comment #1
fizk commentedThis is not a very common issue.