As we've classed objects now, let's remove the $entity_type paramter from hook_file_download_access(). Also we should add type-hinting for the $entity parameter.
core/modules/comment/comment.module:function comment_file_download_access($field, $entity_type, $entity) {
core/modules/file/file.api.php:function hook_file_download_access($field, $entity_type, $entity) {
core/modules/file/file.api.php:function hook_file_download_access_alter(&$grants, $field, $entity_type, $entity) {
core/modules/file/tests/file_module_test.module:function file_module_test_file_download_access($field, $entity_type,
core/modules/node/node.module:function node_file_download_access($field, $entity_type, $entity) {
core/modules/user/user.module:function user_file_download_access($field, $entity_type, $entity) {
Comments
Comment #1
berdirMight want to postpone this on #1245220: file_file_download() passed bogus $field to field_access() or actually just close this is issue as a duplicate of that one. That is shuffling around the parameters of hat function around anyway already. At least for the alter hook.
Comment #2
fagoI'm not sure on postponing this on the other issue, as it doesn't look like there is consensus on how to proceed over there. If the other patch can take care of it earlier, why not.
Comment #3
fgmIf anything, this patch reduces the overall number of parameters, hence also reduces the shuffling involved.
Comment #4
berdirNote that the other issue is already doing exactly this. I'd prefer getting that one reviewed and commited instead of producing conflicts :)
Comment #5
fgmWell if it's exactly the same there won't be any conflict :-)
Comment #6
berdirIt's not exactly the same, the other issue also contains other changes.
Comment #8
fgm#1245220: file_file_download() passed bogus $field to field_access() is now RTBC and includes this one, so if it gets committed we will no longer need this one.