Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file.module patch results in broken file_get_file_references() for downloading private files. #1021

Open
petrowsky opened this issue Jul 11, 2016 · 6 comments

Comments

@petrowsky
Copy link

It looks like there is a patch being applied to the files.aegir.cc version of drupal on file.module. Right around 1059 on the 7.44.1 version I've been testing against.

file_get_file_references() is not returning valid references from the database (unless I'm missing something I should have that I don't)

I'm using nginx_accel_redirect module in conjunction with private file delivery storing files within /private.
It provides the transfer function for menu /system/files. This function is calling all modules with hook_file_download. Obviously, file.module will run file_file_download to return content type and size.

This is failing when using the patched version of file_get_file_references(). Unless it's just an older non-updated version of file.module? I don't know where to look.

I do know that with valid database entries, I get results with the vanilla drupal. I don't get valid references with the omega (patched?) version.

See images. What is the patch being applied if any?

For searchability for anyone else who hits this issue, the simple title might be "Private files won't download with omega Drupal"

Using code from file.module in files.aegir.cc drupal-7.44.1.tar.gz
omega file module

Using code from file.module in drupal 7.44
drupal file module

@petrowsky
Copy link
Author

@petrowsky
Copy link
Author

I think this comment on 1805690 is the issue I'm hitting because nginx_accel_redirect_file_transfer() is not getting the headers it needs in order to add the X-Accel-Redirect: header.

@petrowsky
Copy link
Author

petrowsky commented Jul 11, 2016

Update: The patch applied to Omega D7 seems to be the # 11 patch. I just tried the more recent patch # 25 and I am now getting the file references returned from fields pointing to file (which is my case).

It looks like the issue is still being resolved and it has certainly hit me for more than a few hours of debugging. If patch # 25 seems to work then I might suggest applying that one.

@omega8cc
Copy link
Owner

Thank you Matt for the thorough investigation! if # 25 works for you, we can probably revert the old patch and use the newer patch instead.

@omega8cc
Copy link
Owner

Wait, but isn't # 29 reporting a problem with the patch form # 25 ?

Also, are you sure this is the real problem here? Note that the patch from # 11 is included in our D7 fork since August 15, 2015, so you should notice this for many previous D7 releases and not just latest.

@petrowsky
Copy link
Author

Sadly, it's been quite a while since I've updated. My site was still running 7.32, so I hadn't been using newer releases which had the patch. I did notice that it has been a year and I guess I'm an edge case for using nginx_accel_redirect module. In other words, I hadn't updated in over a year. :)

I can verify that patch # 11 does have a problem with fields which are file types. I've defaulted to using the vanilla drupal version of file.module on 7.44 for now.

It seems like they are still working on the issue and when I did apply # 25 in my dev environment the headers needed by nginx_accel_redirect_file_transfer() were being received. I think you would need to watch the issue to determine if there's a better patch. I know that # 11 within your 7.44.1 and 7.50.1 don't work for me. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants