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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

PrabhuG’s picture

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

Status: Active » Needs review
FileSize
1.23 KB

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

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
FileSize
829 bytes

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.