Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello there,
I installed latest 5.x-2.1 release, and my images started to return 403 access denied. After some investigation, it seems that implementation of file_download hook is wrong:
if ('avatar_selection' == $folder) {
$info = image_get_info(file_create_path($file));
return array(
'Content-type: '. $info['mime_type'],
'Content-length: '. $info['file_size'],
);
}
else {
return -1;
}
I read that hook should not return -1 since it totally stops access, for more information please look similar issue, instead hook should return null ( commenting out "else { return -1; }" fixed my problem )
I'm not some kind of experienced programmer but hope it helps
Comments
Comment #1
stella CreditAttribution: stella commentedI've changed that function so it now returns null instead of -1. I've added it to CVS and it will be included in the next release.
Thanks!
Stella
Comment #2
(not verified) CreditAttribution: commentedComment #3
stella CreditAttribution: stella commentedmarking #178172 and #176504 as duplicates of this issue.
Stella
Comment #4
stella CreditAttribution: stella commentedReleased in Avatar Selection 5.x-2.2.
Cheers,
Stella