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).

Files: 
CommentFileSizeAuthor
#9 file-doc_for_hook_file_download_access-1753976-9.patch829 bytesjfhovinne
PASSED: [[SimpleTest]]: [MySQL] 39,385 pass(es).
[ View ]
#5 file-doc_for_hook_file_download_access-1753976-5.patch781 bytessavithac
PASSED: [[SimpleTest]]: [MySQL] 40,357 pass(es).
[ View ]
#2 file-doc_for_hook_file_download_access-1753976-2.patch1.23 KBPrabhuG
PASSED: [[SimpleTest]]: [MySQL] 40,623 pass(es).
[ View ]

Comments

PrabhuG’s picture

Version:7.x-dev» 8.x-dev
Assigned:Unassigned» PrabhuG
PrabhuG’s picture

Status:Active» Needs review
StatusFileSize
new1.23 KB
PASSED: [[SimpleTest]]: [MySQL] 40,623 pass(es).
[ View ]

The return value of hook_file_download_access_alter and hook_file_download_access in the documenation is removed.

PrabhuG’s picture

Assigned:PrabhuG» Unassigned
jhodgdon’s picture

Status:Needs review» Needs work

The @return should be there for hook_file_download_access(), but not for hook_file_download_access_alter(). Thanks!

savithac’s picture

StatusFileSize
new781 bytes
PASSED: [[SimpleTest]]: [MySQL] 40,357 pass(es).
[ View ]
savithac’s picture

Component:documentation» node.module
Status:Needs work» Needs review

status changed

jhodgdon’s picture

Status:Needs review» Reviewed & tested by the community

Thanks! I'll get that patch committed shortly.

jhodgdon’s picture

Version:8.x-dev» 7.x-dev
Component:node.module» documentation
Status:Reviewed & tested by the community» Patch (to be ported)
Issue tags:+Novice, +needs backport to D7

Thanks! 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!

jfhovinne’s picture

Status:Patch (to be ported)» Needs review
StatusFileSize
new829 bytes
PASSED: [[SimpleTest]]: [MySQL] 39,385 pass(es).
[ View ]

Here is the patch for 7.x-dev.

jhodgdon’s picture

Status:Needs review» Reviewed & tested by the community

Thanks, I'll get that committed shortly!

jhodgdon’s picture

Status:Reviewed & tested by the community» Fixed

Thanks! Committed to 7.x.

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