When view is displaying privet files download links, then only first one can be downloaded. Rest of files share same token which makes them inaccessible even for admin user.

For some reason $this->options['alter']['query'] in render_link() function in views_handler_field_file_link_download.inc keeps it's value in next function call.

Attached patch is temporary workaround.

Comments

haydeniv’s picture

I can confirm this is a bug in 7.x-2.0-alpha2.

osman’s picture

Status: Active » Needs review
StatusFileSize
new992 bytes

The issue is actually for all the roles/users with the permission to download files, not just the user #1.

Attached patch fixes the issue on my tests.

mindgame’s picture

I also explained the reason in #2158547.

dave reid’s picture

StatusFileSize
new754 bytes

Rather than doing an unset on just the query key, how about we try using drupal_array_merge_deep().

dave reid’s picture

Status: Needs review » Fixed

Tested and committed #4 to 7.x-2.x. Thanks everyone!
http://drupalcode.org/project/file_entity.git/commit/1ec501f

Status: Fixed » Closed (fixed)

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

bryan cordrey’s picture

Status: Closed (fixed) » Active

I am still experiencing this issue. I am running the latest dev branch which includes the patch from #4. I have tried to debug the problem but I can only replicate the problem on our PROD server. I found if I disable "page cache for anonymous users" the problem goes away.

dave reid’s picture

Status: Active » Closed (fixed)

For anonymous users the token depends on the ip address, so you would need to disable page caching for that specific view in order for it to work for anonymous users. Either way, let's leave this fixed and file a new issue if necessary.