I set up two different products that reference the same file using filefield_source. The intent that if you purchase the file on one product, you'd get access to that file on the other product. (For my use case, this was an attempt to use file references as a way to achieve bundles. See #1372950: Integrate Commerce File with Commerce Product Bundle)

When I purchase the file on product A, then go to the display node for product B, the file doesn't show up. Looking at the schema for licenses it didn't seem like there was a direct reference to the product, but I'm guessing that the table field_data_commerce_file_license_file is where this check begins. Because there is no license for this product, access is not granted. Going directly to the file should use the uri to determine access, so my expectation was that this would work.

I'm getting a bit lost in how the file access check is happening when I walk the code, so I wanted to post and confirm. My guess is that this is by design, but since I spent some time digging around on this, I figured I'd post for others who go down this path. Thanks in advance.

Comments

bojanz’s picture

Status: Active » Fixed

I am guessing that the problem here is that those two products actually have two different files (different fids) with the same uri (file location), hence commerce_file doesn't treat them as one same file.

Status: Fixed » Closed (fixed)

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