Closed (fixed)
Project:
Commerce File
Version:
7.x-1.0-beta2
Component:
Access Control
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
17 Jul 2011 at 20:33 UTC
Updated:
24 Jan 2012 at 13:05 UTC
Jump to comment: Most recent file
Comments
Comment #1
recrit commentedI've tested with RC1 and everything works.
Please give more details on your setup - settings of commerce file field on product, any commerce files on your line items (check table field_data_commerce_file_line_item_files for any instances), accessing as user 1, etc
Comment #2
artatac commentedI am finding the same. I created a new product type via admin/commerce/products/types/add called downloadprod > added a new field
filedownload field_filedownload Commerce File Commerce File
in ACCESS LIMITS
License duration - unlimited
and the other 2 fields left blank for unlimited > save
I then went to admin/commerce/products/add/downloadprod and created a product and attached a pdf via the new field.
I then created a product display and then bought it. I received an email confirming the purchase but not a second email with a link in it. I did note that the order status was 'pending' so I forced it the completed - but no extra email.
you can test it via http://venturacottage.homedns.org/commerce2607/node/4 and I can suply login details if it is of help.
DRupal is 7.4 and Commerce is 7.x-1.x-dev (which I can upgrade if you feel is the issue)
Thanks
Comment #3
recrit commentedThere is no default email that gets sent out unless you set it up in a Rule. Example payment method is just that - an example, so it will put the order as pending unless you update the Rule for example payment to push the order to complete while testing.
Once an order is completed, check the files tab in your user account to see if you have the file there.
Comment #4
artatac commentedOk thanks
I shall have to sit down and learn more about rules or find some examples
Best wishes for a great module
Comment #5
mikerz commentedOkay,
I didn't see any instances of field_data_commerce_file_line_item_files in my sql, but I did see the structure for "commerce_file_license_line_items_line_item"
This is what I did, I created a new Product Type "Special Item" and gave it a field of "Commerce File"
I created a new instance of "Special Item" called "hat1," and I uploaded a file for the commerce file field.
I logged on as user 2 (just a standard authenticated user), and purchased the newly created "hat1" (I made a display type for it with the standard "add to cart" button showing up)
I purchased the item with example payment
Next, I logged on as administrator and changed the order to "completed" (and verified that the item was listed)
No commercial file licenses were made, and no files were listed for the user.
Comment #6
artatac commentedI have also retested this and at /user/1/licensed-files there are no licenced files after buying a download product
Comment #7
recrit commentedi believe i tracked this down and just pushed some commits. You will have to pull from the git repo b/c the dev tar only builds once a day or something.
I tested this with a new product type and had the files issued after marking the order completed.
@mikerz:
Please verify that you have the commerce file field on the line item type - view admin/commerce/config/line-items/product/fields
Comment #8
recrit commentedComment #9
artatac commentedyes see below
Commerce File commerce_file_line_item_files Commerce File Commerce File edit delete
Comment #10
recrit commented@artatac - great.. so the field is at least added correctly. Can you test the latest in the repo to see it if works for you?
Comment #11
artatac commenteddownloaded http://drupalcode.org/project/commerce_file.git/snapshot/3ac6d221a853cf1... and replaced current module > ran update.php > go following error
created new downloadable prod and display
Still no files available
Regards
Joe (can give you admin access if it helps)
Comment #12
recrit commentedthat is an old snapshot... use http://drupalcode.org/project/commerce_file.git/snapshot/80f8f45.tar.gz
Comment #13
artatac commentedOK pleased to report that once I go into admin/commerce/orders/3/edit and alter the order to completed then the new file appears at /user/1/licensed-files
Thank you :-)
What I now need to work on is that even though I am using the demo payment module - I would have expected it to treat that as paid and updated the status automatically to completed. Thus making the file available in licensed files and also I presume I could then (try) to generate an email with a link in it rather like Ubercart used to do.
Comment #14
recrit commentedGreat! Before marking as fixed, I'll wait for mikerz to report back.
For example payment during development,
The default checkout rule is "Update the order status on checkout completion". You can alter or clone it to a new rule with a higher weight so it fires after that one. Altering it to move it to completed status instead of pending.
There are a few events you could add a rule to...
If you know you would be selling only digital content:
You could trigger the rule on "After updating an existing order". Add conditions to check the previous status was not completed and that the new status is completed. Add an action to send the email pointing them to log in and visit user/{their uid}/licensed-files.
If you have mixed products, you can trigger the event on "After saving a new commerce file license" since one would be created on order completed if its their first time buying the file.
Comment #15
recrit commented@mikerz: try the latest dev and reopen if you still have an issue
Comment #17
jessicakoh commentedHow to re-create the missing "commerce_file_line_item_files"
I already ran the "Features - Commerce Download". The license is still not being issued after payment completion.
Commerce File snapshot: http://drupalcode.org/project/commerce_file.git/commit/ba438da
Comment #18
inolen commentedJust installed, having the same problem as above. The rules is triggered, however a check in commerce_file_license_issue_line_item() fails around line 816 (// exit is no files).
Comment #19
lloydhazlett commentedSame issue here also - rule is triggered and commerce_file_license_issue_line_item() is called, but it never enters the line item field items processing loop at commerce_file.entities.inc:860 where the licenses should be created. Tested on latest commerce_file dev with ctools 7.x-1.0-rc1, entity 7.x-1.x-dev and rules 7.x-2.0-rc1 and as user 1.
Comment #20
inolen commentedDid anyone happen to figure out a fix for this? Was hoping when I circled back around to this tomorrow there may be a fix (since it seems like something was already checked in to fix it), but if not I guess I'll dive in tomorrow.
Comment #21
AimAdvantage commentedHaving a similar issue-
Everything is working through checkout.
However- When I return to my profile to see my orders, the file name is under orders but there is no link to the file to download the mp3.
Very simply- trying to give access to mp3 music files after paypal payment.
The order shows up in the user's profile, however, the file link or access is not there like it was in Ubercart. Any help on this?
Here is the dev link for the store for MP3 downloads-
http://www.rondavidmooreministries.com/RDMstore
any help on this would be great
Thanks-
Aaron
Comment #22
13rac1 commentedI added watchdogs throughout the code to locate the (incorrect) commerce_file_license_issue_line_item() function exit point. On my site, it is exiting early at this return:
Comment #23
recrit commented@eosrei:
can you check your database table field_data_commerce_file_line_item_files and see if there are any entries. That is the field that is on the line item entity which snapshots the files from the product during checkout.
Comment #24
recrit commentedmarking as dev since lloydhazlett reported using dev.
All - please make sure you are using a clean install of the dev version - beta1 is not supported nor is any beta1 to dev upgrade
Comment #25
recrit commentedtagging
Comment #26
inolen commentedFinally got back to this tonight.
I was working with a fresh install of 7.x-1.x-dev and I noticed that I didn't have the field_data_commerce_file_line_item_files table.
So, I wanted to try to reinstall the module but I couldn't with Devel due to a rules include, couldn't reinstall through modules interface due to a locked field dependency (that seemed a bit odd), so I wrote a small script to reinstall and then the table showed up and all was well:
I definitely originally installed with 7.x-1.x-dev, so I'm not really what happened to make that table not get created originally.
Comment #27
jessicakoh commented@inolen
Thank you so much for the tips. I got mine running.
Comment #28
scottrouse commentedThis isn't working at all for me. I've got the module installed on a site in progress, and licenses are not being issued for purchased files. I've tested on a local install and verified that no license is being issued. Here are the steps to reproduce:
The Rules admin screen shows a number of errors (https://skitch.com/scottrouse/gbc2n/fullscreen) including Error: Unknown condition commerce_file_license_condition_limit_is_unlimited for Control access to licensed file downloads. I also have the following message in my error log:
The field_data_commerce_file_license_file table is empty.
Comment #29
jessicakoh commented@scottrouse
Have you tried running #26's code in Devel's Run PHP Code?
Comment #30
tvilms commentedHi, I've been following this thread. I can verify that I just followed @jessicakoh's pointer to #26 and ran @inolen's script. The missing DB table was created during the module uninstall+reinstall process. File download buyers are now able to access the licenses after completing the purchase. Thanks @jessicakoh for specifying to run the script in Devel's Run PHP Code block - your tip in #29 together with #26 cleared it up for me.
Comment #31
scottrouse commentedI ran the script on my local dev site that I created using the steps in #28. Nothing changed. Same database tables, same results (no licenses issued), same Watchdog and Rules errors. As I mentioned in #28, the field_data_commerce_file_license_file existed after following my install steps, but no licenses are ever entered into that table when products are purchased (and orders are marked as completed).
It seems to me that the Rules/Watchdog errors I mentioned may help to resolve this, but I'm not sure where to go from here with them.
Comment #32
recrit commentedre-tagging to 7.x-1.0-beta3
Comment #33
jessicakoh commentedComment #34
jessicakoh commented@scottrouse
I am not asking you erase your existing website and start from scratch. Try a fresh installation. Then compare rules and the table. You might have missed out something.
Alternatively, you can try the ready made commerce file package (commerce download?).
Comment #35
scottrouse commentedI understand. In #28, I was referring to a fresh local installation. I completed and documented my steps very carefully (complete with screen shots) in order to prove that the module does not function properly.
I can give the commerce file package a try, but, even it works, that doesn't solve my outstanding issue on the existing site.
Is there something else you suggest I try for the almost-completed site to try to get licenses to be issued? Or is there some more information I can provide about that installation that may help resolve the problem?
Much thanks,
Scott
Comment #36
jessicakoh commentedI would still suggest trying out the commerce file package.
If that works, you'll have a model to compare to. Look into "Product Type".
Comment #37
scottrouse commentedI did manage to resolve my issue with the script at #26. Thank you.
I've leave this issue open, I guess, since it still didn't work "out of the box."
Also, changing this to beta2 since it's much more recent than the dev version.
Comment #38
recrit commentedfor reference, i have created an initial pass at documentation at http://drupal.org/node/1356212
I am closing this issue since there have been some changes to the install and uninstall of this module. Please test the dev on a fresh install and open any new issue.
Comment #40
mediapal commentedHi,
I stuck here with the example payment.
Everything works so far: anonymous user put some files in the cart. Going thru the checkout procedure and pay with "example payment"
When the user login the order status shows "complete" but no files to download. The admin has to take the order to the status "pending" and again to
"complete" and after this the user gets the files ready to download.
Here comes the funny part: Is the user login already and doe´s another order again, then, and only then the files are ready to download, as those suppose to.
I tried on a local and a live server: no different. I tried, like mention in an earlier post to set in the rules the default action from "pending" to "complete",
nothing would change.
Has anybody an idea whats wrong here?
Kirk
Comment #41
recrit commentedin case anyone stumbles to here .. #40 above was addressed at #1405740: File License Problem After Paying