Hello, I have installed file_entity 7.x-2.0-alpha3, Commerce File 7.x-2.0-beta3, Commerce License 7.x-1.3.
After a product with an existing file on Amazon s3 was purchased, and clicks on the link in the user files tab - the link takes the user to Amazon xml page and says
"Access denied".
I saw this issue and it seems not solving the problem...

Where to start?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dorijrs’s picture

Assigned: dorijrs » Unassigned
quietone’s picture

I've had 'Access Denied' on all licensed downloads as well. I'm just learning commerce and I believe I had it working a few weeks ago but when I returned to work on it (local dev site) it was failing. So maybe my memory is wrong (won't be the first time).

Anyway, I rebuilt the dev site, made one licensed download, purchased and confirmed etc and definitely got 'Access Denied' for the anonymous user making the purchase as well as the administrator. After reading Access token generation changed in file_entity module. I decided to try the latest dev version of Commerce File. And it worked straight away.

With these I got 'Access Denied':
file_entity: 7.x-2.0-beta1 ( 2014-10-04)
commerce_file: 7.x-2.0-beta3 (2014-06-04)

With these it works:
file_entity: 7.x-2.0-beta1
commerce_file: 7.x-2.0-beta3+3-dev

jigish.addweb’s picture

Problem is generated with file_entity and commerce_file.

You can refer this: https://www.drupal.org/node/2183975

You need to alter your menu with your custom module

function YOURCUSTOMMODULENAME_menu_alter(&$items){
        if (empty($items['file/%file/download'])) { //replace with this line
                $items['file/%file/download'] = array(
                  'page callback' => 'commerce_file_download_page',
                  'page arguments' => array(1),
                  'access callback' => 'commerce_file_access',
                  'access arguments' => array('download', 1),
                  'type' => MENU_CALLBACK,
                );
        }
}

Hope this helps you.

Thanks!

DamienMcKenna’s picture

Version: 7.x-2.0-beta3 » 7.x-2.x-dev
doostinharrell’s picture

I had this issue recently and realized that the `file_entity_get_download_token` function was updated in more recent versions. Instead of copying code from `field_entity` into `commerce_file` we should use the functions provided by `file_entity` if it's installed. I've got 2 patches for this one for dev and another for beta3 which solved my issue.

I hope this helps someone else.

doostinharrell’s picture

Status: Active » Needs review