Closed (fixed)
Project:
Commerce File
Version:
7.x-1.x-dev
Component:
Access Control
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Jun 2012 at 06:32 UTC
Updated:
28 Aug 2012 at 11:11 UTC
Jump to comment: Most recent file
Comments
Comment #1
recrit commentedIt's hard to tell what's going on from only knowing that they are getting denied.
Can you provide some more information using the devel/php window?
The following will provide more information about a troubled license in question.
Comment #2
hmartens commentedHi recrit
Thanks for your help. How do I go about using the devel/php window? I've installed devel but that's all I know how to :)
Sorry
Comment #3
recrit commentedyou just need to visit the path "devel/php", paste the code into the textarea, and change the ids to your license in question
Comment #4
hmartens commentedHi recrit
Thank you thank you thank you for helping me! Ok I filled in the details and it confirms that there shouldn't be anything wrong yet this user cannot download the file...I've logged in as them and also couldn't download it. They could download it before, but not anymore. There's a couple of users in the last month that has complained about similar problems.
Attached is a screenshot of the php result
Comment #5
hmartens commentedAll I can remember doing on the website besides the normal module updates is that I installed Commerce Multicurrency on May 25...and then that same day I disabled it because the Paypal module seem to not support the South African currency...
I've been trying to think what else could have changed but can't think of anything. The site has been running stable for such a long time I didn't need to tweak or fix anything. And I can't just add another license file for the user because it Commerce File doesn't except filetypes other than "mp4, m4v, flv, wmv, mp3, wav, jpg, jpeg, png, pdf, doc, docx, ppt, pptx, xls, xlsx" . So I don't even have a work-around until the problem can be solved.
Recrit, I can give you access to the website if that would help although you probably have too much work "to do my work for me" :)
bah humbug!
Comment #6
hmartens commentedNow I'm getting an error...This morning when I'm trying to run this same code again to test a license I get the error as attached."Notice: Trying to get property of non-object in eval() (line 7 of /home/embrojpq/public_html/sites/all/modules/devel/devel.module(1285) : eval()'d code)."
Is this a devel error or a license error?Nevermind..think that error was just a flux...but I still need to fix this licensing problem...
Thank you for your help :) Really appreciate it!
Comment #7
recrit commented@hmartens:
Check if you have any other contrib modules implementing hook_file_download, hook_file_download_access, or hook_file_download_access_alter. Commerce File controls access to the file with hook_file_download, but any other module can implement the hooks to deny access.
Comment #8
hmartens commentedThank you @recrit. Is there any easy way to find that out (like a command that I can run) or do I have to go through each module and see its properties? Is there a way to reset commerce to have dominion again in my shop? I can't think of anything that I have installed recently though...
Thank you so much for your help!
Comment #9
recrit commentedyou can search on the command line from your web root for each of the hooks:
* Note change the directory if your modules are not in sites/all/modules
Comment #10
benjarlett commentedI think I'm having the same issue.. if I'm understanding it correctly...
when I do that search I get the following
Note: the module file_force isn't active.
I'm liking commerce alot...but I do need purchasing downloads to work... help much appreciated.
Comment #11
hmartens commented@recrit
I don't have direct access to the server as it's sitting with a service provider...so I can't run these commands.
If another module is interfering with the licenses, will it make certain licenses work and certain not to work or will it make all licenses to not work? I'm having problems where certain licenses, especially the from 2 months ago and older not to be accessable even though the that php script you gave me says it should be active.
Thank you for all your help!
Comment #12
hmartens commentedMorning @recrit
I asked the service provider to run the command for me. This is the results:
===
# grep -rn _file_download sites/all/modules
sites/all/modules/imce/imce.module:93: * Implements hook_file_download().
sites/all/modules/imce/imce.module:96:function imce_file_download($uri) {
sites/all/modules/entity/entity.module:963: * Implements hook_file_download_access() for entity types provided by the CRUD API.
sites/all/modules/entity/entity.module:965:function entity_file_download_access($field, $entity_type, $entity) {
sites/all/modules/commerce_file/commerce_file.module:583: * Implements hook_file_download().
sites/all/modules/commerce_file/commerce_file.module:585:function commerce_file_file_download($uri) {
sites/all/modules/commerce_file/commerce_file.module:750: // - allow display, hook_file_download() will allow download if they have access
sites/all/modules/ctools/ctools.module:475: * Implementation of hook_file_download()
sites/all/modules/ctools/ctools.module:480:function ctools_file_download($filepath) {
sites/all/modules/commerce/modules/product/commerce_product.module:171: * Implements hook_file_download_access().
sites/all/modules/commerce/modules/product/commerce_product.module:190:function commerce_product_file_download_access($field, $entity_type, $entity) {
====
Can you see anything here that is alarming and could cause certain licenses to not to work?
Thank you for your help.
Comment #13
recrit commentedI've committed a fix for EntityFieldQuery being altered for user permissions - http://drupalcode.org/project/commerce_file.git/commit/685fb23, @see http://drupal.org/node/1597378
The latest dev does have some updates, so you will need to run update.php
Comment #14
recrit commented@hmartens:
The commits in the latest dev have fixed file download issues for others. If the dev version does not work, then re-open.
Comment #15
hmartens commentedThank you so very much Recrit for all your hard work! I definitely owe you coffee or lunch at a future Drupalcon ;) What is your twitter handle?
I will test this out shortly...