just want to say again, that I'm diggin the module. I realise that this mopdule is not fully setup for 5.2 but it's working really good in with only some minor issues and was hoping someone would have the time to help me out.
I've got the paid adverts working with the sandbox paypal. As it stands when I create a new node and pay for it. It doesn't show up as published. I've looked into the lm_paypal_subscribers table and noticed that the nid was 0 for all the nodes that I was purchasing. I've been looking through the module but am unable to see where things are missing or even if they are. Any help on this would be appreciated. It seems like it should be something really small, but I can't seem to track it down.
I'm running:
Drupal 5.2
lm_paypal HEAD datestamp:1184976358 - using paid adverts
cck 5.x-1.6-1 - for two content types for publishing
views 5.x-1.6 - to show the catagorized content types
nodefamily 5.x-1.3 - to limit the amount of nodes they can create.
If there is any other info needed let me know. Thanks.
Comments
Comment #1
strawman commentedAs I dive into this, it seems that once the node has been created and you click on the "Pay Pal Publish" tab. You are taken to the "terms and conditions" where click on the "I agree". The next page it takes you to is the "Pay Pal Subscribe" page. It shows in the url that its a type 1 subscription. Type one being "kind" as apposed to "role" right?
When I look at the source code it shows that the hidden form fields. I looked at the "custom" field that should be carrying the "node id" of the node I am paying for (this info is based on the "lm_paypal_subscriptions.module" lines 600 - 605) . Instead of carrying the "node id" its carrying the "user id" instead? How can I fix this. Am I on the right track. Does any of this make sense? This is my source code showing my form and its hidden fields:
Thanks again for any time that can put into this. I myself am going to keep pluggin away at it...
Comment #2
strawman commentedhmmm...I guess the above thought wasn't it....This will be my personal log and notes of my process I guess of how to solve the paid subscription issue for Drupal 5.2. Hopefully soon I will figure it out...soon...as I need to this to be running for a client in the next week.
If anybody can help me that would be awesome, otherwise follow along.
My process now will be to check the ipn send back information. I don't know exactly how this module works but I'm assuming that when the IPN comes back it will hit an update query for the db and should input the $nid there...maybe thats where the issue is?
Comment #3
codenamerhubarb commentedHey strawman, I'm in the exact position as you were. Did you (or anybody else) manage to solve this problem?
Comment #4
codenamerhubarb commentedUpdating the status to active...
Comment #5
codenamerhubarb commentedI figured out the problem, the nid value is not carried when you include terms and conditions. I left the terms and conditions box for that particular subscription empty and that fixed the problem.
I'll have to figure out a better way to include the terms and conditions.
Comment #6
strawman commentedhey there...interesting to see this still going on...personally what I did was just create a session with the nid and then killed it on the payout area...a bit tricky but worked well...I couldn't spend too much time working anything better as my time was limited for the client...I can give more detail if needed....or let me know if you find a better way...
Comment #7
Leeteq commentedGiven the critical status and the age of this issue, it would be good if a patch or the code or an example workaround was posted here. I actually wonder if this issue deserves critical status since it has been open so long without resolution?
Is this something everyone will run into or just occurring under uncommon circumstances?
Comment #8
Leeteq commentedOoops, accidentally used the issue tags field as comment title...
Comment #9
lyricnz commentedI haven't got time to test this right now, and I'm not familiar with the code, but the code at question looks like:
So if you are getting the UID in $custom, then either $so->kind is 0 or 2, OR $nid is not set. This $so value comes directly from {lm_paypal_subscriptions}, and $nid is a param to this function.
// kind 0 is a role subscription, kind 2 is a group... kind1 is a node subscription.
So, what's in the subscriptions table? Anyway, if it breaks just when you have T&C set, it's probably something broken there. Try adding debugging code to dump out the $form_data whenever you see it. I'll get to this if I get a chance!
PS: the way this code uses magic numbers, and bit-packing into the custom field, is pretty indecipherable. I'm working on a significant refresh in a new branch, but it's pretty broken right now.
Comment #10
lyricnz commentedI just tried to reproduce this with the latest LM Paypal, and can confirm the symptom! Let me make sure we're doing the same thing:
I installed a brand new Drupal 5, and LM Paypal 5.x-1.0. I created a new node subscription. I then attached "Page" to this subscription type on the paid advertisements module, and then went to the paypal tab of the node, and looked at the form. The "custom" field was set to a number about 130000 (which is the uid and nid mixed together - long story). Ie: that's working fine.
I then edited the subscription, added some T&C, and created a new node (so this would take effect). Clicked on the paypal tab, saw the T&C displayed. Clicked I agree, then got to the payment page, with the (hidden) form. Now "custom" has a value of 1.
I'll keep looking.
Comment #11
lyricnz commentedThe problem is that the T&C form redirects to a different URL, which loses the nid that you were viewing at the time. I don't know why it would do this - but if you comment out the last line of lm_paypal_subscription_terms_submit () - around line 818 of lm_paypal_subscriptions.module, you should be right
becomes
Please let me know how this goes.
Comment #12
lyricnz commentedI asked codenamerhubarb for feedback on above, but he said:
Thanks,
I saw your reply. However, I ended up not needing terms and conditions on the lm_paypal subscription page after all, instead I included them with a checkbox on the initial CCK form which works quite well. I'm sure your solution will help others though.
Cheers,
Jake.
Unless someone is willing to actually test and verify this, I will drop the patch, and mark it "won't fix". Without testing by people who really use the module, I don't know if the change breaks anything else.
Comment #13
Leeteq commentedI will get to test this soon now.
Though, the way the general Drupal development goes, it makes sense to remove the Terms & Conditions part from this module and let CCK deal with it as was codenamerhubarb's solution. It also makes sense to not even get started on the payment information before the T & C has been accepted.
Removing it would also make this module even less prone to errors, which is a good thing, generaly speaking.
If removing it, I suggest including a comment and reference about it in the readme.txt file, with a link to an accompanying handbook page here that describes how to get the T & C set up with CCK.
Comment #14
lyricnz commentedMostly agree, but I am not doing active development on any of the current releases, and am instead focussing on a major cleanup/refactor in the 6.x-2.0 branch.
Comment #15
codenamerhubarb commentedI don't really have time to change back to the original way the terms and conditions work and so I can't test lyricnz's code but if you want to add a Terms and Conditions area as a CCK field, this is how I did it...
Add a new field Text->Single on/off checkbox
Set up as follows:
Help Text is your actual terms and conditions, i.e. "I agree to blah blah blah".
Text processing: Plain text
Allowed values list:
0|FALSE
1|I agree to the following terms and conditions
Comment #16
Leeteq commentedOK, so just plain fixed content. Simple and functional. Can also use the default revision system to manage changes to the CCK node. There is a dedicated T&C module for those who want special features.
Comment #17
lyricnz commentedI've committed this anyway, as my basic testing appears to work fine.
Comment #18
Leeteq commentedWas this committed only to 6.x-dev? The issue was filed against 5.x. Cannot see any other updates here.
Comment #19
lyricnz commentedI just commit this to D5 branch. Please test it (you will need to wait for a new -dev release to be packaged, or checkout from CVS). Or make the change yourself, per comment 11 above.
http://drupal.org/cvs?commit=165605
Comment #20
john franklin commentedClosing all 5.x issues. Update with 6.x details and re-open if this is still an issue.