The documentation for hook_file_download_access_alter() says that implementations should return an "array of grants, keyed by module name, each with a Boolean grant value" (making it a quite unusual alter hook).
The example implementation does not return such an array.
The documentation should be clear and consistent about how altering file download access is achieved (i.e. by returning a value or by modifying the $grants parameter).
Comment | File | Size | Author |
---|---|---|---|
#9 | file-doc_for_hook_file_download_access-1753976-9.patch | 829 bytes | jfhovinne |
#5 | file-doc_for_hook_file_download_access-1753976-5.patch | 781 bytes | savithac |
#2 | file-doc_for_hook_file_download_access-1753976-2.patch | 1.23 KB | PrabhuG |
Comments
Comment #1
PrabhuG CreditAttribution: PrabhuG commentedComment #2
PrabhuG CreditAttribution: PrabhuG commentedThe return value of hook_file_download_access_alter and hook_file_download_access in the documenation is removed.
Comment #3
PrabhuG CreditAttribution: PrabhuG commentedComment #4
jhodgdonThe @return should be there for hook_file_download_access(), but not for hook_file_download_access_alter(). Thanks!
Comment #5
savithac CreditAttribution: savithac commentedComment #6
savithac CreditAttribution: savithac commentedstatus changed
Comment #7
jhodgdonThanks! I'll get that patch committed shortly.
Comment #8
jhodgdonThanks! Committed to 8.x. I can't get the patch to apply to 7.x, so it needs a backport. Also, please leave the component at documentation. It's definitely not in the node module!
Comment #9
jfhovinne CreditAttribution: jfhovinne commentedHere is the patch for 7.x-dev.
Comment #10
jhodgdonThanks, I'll get that committed shortly!
Comment #11
jhodgdonThanks! Committed to 7.x.