I recently added 4 new file downloads and the licenses are not getting issued for these, either upon order completion or on the license order operation page. There is a nice notice at the top that informs me "No licenses were updated or created for . . . " but I can't figure out what is going on. All of the previous file downloads seem to be still working fine. It has been 11 months since those were created and only in the last week since I created the new files. I know I have updated Drupal Commerce in that time. Is there somewhere I can figure out where the process is breaking down?
Comments
Comment #1
sher1 commentedI had been running beta4 but tried going to the most recent dev to see if that would help and it hasn't. It also looks like the last added file that worked was 6 months ago. I have even tried creating a new product today with the same results
Comment #2
sher1 commentedI have now reverted to commerce 1.4 and it hasn't fixed the problem.
Comment #3
pierrepaul commentedI'm in the same situation. I've been playing with it since last week. So far the only thing I've found was, that no file were associated with the product sold, here is some debug :
In includes/commerce_file.entities.inc +972 :
if (empty($line_item_wrapper->{$line_item_field_name}) || !($line_item_wrapper->{$line_item_field_name}->value())) {
return $updated_count;$
}
Somehow commerce_file can't see any files being "sold". So it always returns. I'm starting to think that maybe, it would be related to changes into Entity API.
Comment #4
pierrepaul commentedUse case : adding a product to the cart
Assumptions:
- When adding a product to the cart, a commerce_line_item is build with the files associated to the products (according to http://drupal.org/node/1356220 the first point of the section : What happens when a product with a file is purchased?)
In commerce_file.module +1299 we have the mighty function :
In my case field_name equals "commerce_file_line_item_files" which is the expected behavior (I think).
The dirty line_item_wrapper never has this field set so it always returns NULL.
Further down the function, we can see it should be loading the commerce_line_item and make sure nothing is serialized.
This module is huge really, it's hard to grasp what it's doing and what it should be doing. I'm installing kickstart and will install commerce_file on top of it and try to see it's working there.
Comment #5
pierrepaul commentedInstalling the module on kickstart2 works. A field is added on the commerce_line_item named : commerce_file_line_item_files by default just after installing. For some reasons it's not on my other install. I guess something is going wrong when installing the module in my other project.
I can't create the field by hand. When creating the field by hand it adds the prefix field_ in front it.
Comment #6
pierrepaul commentedI was using a database that had a previous install of commerce_file installed but, I think, got uninstalled in the past. The table
field_revision_commerce_file_line_item_filesand the tablefield_data_commerce_file_line_item_fileswere never dropped. So I dropped them manually then put a custom update method in commerce_file.install
So when adding products to the carts I can now see commerce_files being added as well. Still, no licenses are issued after the completion of the order.
I guess I will have to dig and try to debug every try{} catch{} block not logging any errors.
Comment #7
pierrepaul commented@sher1 : could you check your watchdog logs? If you see something like :
Error: Unknown data property commerce_file_license_file.
There is a good chance it is related to : http://drupal.org/node/1904608
Comment #8
sher1 commented@Pierre, the weird thing is that it still issues licenses fine for all products except the ones I added recently. For now, I have just disabled the new products. If it were every product it would be easier to track down but also make it more urgent
Comment #9
mrawat commentedI'm having the same problem too.
I've installed Kickstart2, add all my file products and checked-out several times and set the orders to complete, yet no licences seem to be issued.
When I check the order, and go to the licences tab, it says 'No purchased files found.'
I've spent ages putting up all the file content so i hope there is a easy fix for this!
Comment #10
mrawat commentedOk, so maybe I was doing this wrong, but I think I've figured out my issue.
I originally added the Commerce File field under Content type, which wasn't granting licences when the product was purchased & order completed.
I have now added the Commerce File field under Variation type and this seems to work!
Comment #11
daveparrish commented@mrawat
I had the same issue with Commerce Kickstart. Commerce files would grant licenses if the file was created in the variation. If I added the file under the content type then the customer would not get the file after checkout.
Is this how it is suppose to work?
Comment #12
sher1 commentedFinally found some significant time to work on this and started digging through db tables - Nothing
Started looking at the products - - why isn't the download showing up?
That's right, you can't get a file license if there is not file to license. I was sure I had done that but obviously I had not or it would have been there. Closing in disgust that I hadn't already checked that.