Download & Extend

hook_file_download() should pass $file objects rather than $filepath

Project:Drupal core
Version:8.x-dev
Component:file system
Category:task
Priority:normal
Assigned:Unassigned
Status:needs work
Issue tags:API change

Issue Summary

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.

AttachmentSizeStatusTest resultOperations
hook_file_download_obj.patch.patch4.71 KBIdleFailed: 10818 passes, 0 fails, 2 exceptionsView details | Re-test

Comments

#1

Status:needs review» needs work

The last submitted patch failed testing.

#2

bump - would be nice to have before freeze

#3

bump - let's re-roll?

#4

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.

nobody click here