final step - download issue
jwells - December 1, 2007 - 10:28
| Project: | Quickfile |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
this is a very handy module and I appericate the express action and not having to load the ecomm module to sell just one eBook. many many thanks
this module has been a struggle for me, test and go, test and go - Thank you for adding the Paypal Sandbox :-)
I've made it to the final step - Download - I keep ending up and the Can'd Download node
I checked the path on the download quickfile link
the path is as setup - except for the last part of it
..../2AY05715AD455945N/62/paypal
my test file was readme.txt - but I don't see where it is looking for this file
did I do something silly or lame?
any advice appericated - big time stuck
thanks
JW

#1
Well, it looks like there is not much work done to update this module, but I've noticed that the %txnid token is not being replaced correctly.
After a successful transaction the url you are redirected to looks like:
http://mydomain.com/thankyou?txnid=0&nid=34&tx=1859340777&amt=10.00&meth...
The url that is on the download page is:
http://mydomain.com/quickfile/download/0/34/authorize
The url in the quickfile administration is:
http://mydomain.com/thankyou?txnid=3&nid=34&method=authorize
Which takes you to the download link of:
http://mydomain.com/quickfile/download/3/34/authorize
All other tokens in the thank you emails are replaced correctly, except for the %txnid.
This may not be your issue, but it is what is wrong with mine. I'll look for a solution, but if anyone else finds one please post!
#2
I found out what my problem was.
On line 2325 of quickfile.module it used the php function mysql_insert_id() to return the value of the auto-incremented txnid. This function was returning 0 for me, not sure if it is a bug, or a server issue but my solution is below.
I replaced this line, which read:
return mysql_insert_id();With:
$result = db_query("SELECT txnid FROM {quickfile_transaction} ORDER BY txnid DESC");$data = db_fetch_object($result);
return $data->txnid;
I believe that mysql_insert_id() should work here, and it did on my server for a time, but it was not returning the proper value and my fix above should work regardless, as it grabs the highest txnid right after the newest transaction was entered in the DB so it should always pull the correct txnid.
#3
thanks