Ok, I have gone through the purchasing process, and have a file sitting there in 'my files' waiting for download... however, clicking on 'download' follows the link "http://sitename/store/myfiles/download?file=filename" - which produces a file-not-found error!
I have traced this to the 'ec_file_create_url' function in file.module not taking the user-id into account... So, I've patched it and it now seems to work (test case of 1!)
Patched version is:
function ec_file_create_url($path) {
global $user;
if (strpos($path, variable_get('ec_file_directory_path', 'files')) !== false) {
$path = trim(substr($path, strlen(variable_get('ec_file_directory_path', 'files'))), '\\/');
}
return url("store/myfiles/$user->uid/download", 'file='. $path);
}
(additional parts are 'global $user' and the '/$user->uid' in the return.)
Comments
Comment #1
matt westgate commentedThis has been fixed. Thanks.
Comment #2
(not verified) commentedComment #3
Kirk Zurell commentedThis bug seems to have reappeared.
When accessed through the URL
http://localhost/drupal/store/myfiles
by a user with "administer store" access, arg(2) sets $uid to be null, and the URLs for individual files are broken. They work fine when not able to administer the store.
Thanks for your attention.
Comment #4
Kirk Zurell commentedAt some point, arg(2) will be the user under administration. For now, this completely brainless patch:
Comment #5
simeassigning to me
Comment #6
brmassa commentedFixed on eC4