On of my pet peeves has been the fact that hook_file_download() passes a path to a file in rather than a $file object. This forces each module to query the database to load it rather than being passed into the hook.

CommentFileSizeAuthor
hook_file_download_obj.patch.patch4.71 KBdrewish
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch failed testing.

pwolanin’s picture

Issue tags: +API change

bump - would be nice to have before freeze

pwolanin’s picture

bump - let's re-roll?

tstoeckler’s picture

Version: 7.x-dev » 8.x-dev

At the current stage in the Drupal 7 development cycle this seems to be more a feature than a bug.
Moving to Drupal 8.

Dave Reid’s picture

Issue summary: View changes
Issue tags: +Media Initiative
slashrsm’s picture

Status: Needs work » Closed (duplicate)
Related issues: +#2148353: File access (hook_file_download) does not use an EntityAccessController
Gábor Hojtsy’s picture

Issue tags: -Media Initiative +D8Media

Fix media tag.