I've been looking at the issue shown in a screenshot attached to this post where, upon subscription purchase, user role is upgraded twice - even if payment status is not 'complete'.
I haven't fully debugged this, but I have made a little headway. Sorry I can't create a patch, but I can describe the code change that partially fixes this and point to the general location in the code where I *think* the remaining problem lies.
Using $Id: store.module,v 1.81 2006/03/04 03:11:34 gordon Exp $,
around line 765, store_change_role() doesn't seem to be conditional on a payment status of 'complete'...
so just change store_change_role($txn, $add_to_roles); to
if ($paid) {
store_change_role($txn, $add_to_roles);
}
and from what I can tell, all will be well with *that particular instance* of the user role upgrade. (It happens properly, only on completed payment.)
Now, as for the other instance...
I've tinkered with store_change_role() on line 723, as well as the conditions for $add_to_roles = TRUE; on line 694. Nothing I've tried has had a correct impact on that instance, so I'm at a loss there.
Just thought I'd post what I have thus far in case it helps anyone who has plans to look at this issue.
Comments
Comment #1
guckie commentedOops! I left this out...
Around line 735
change
if ($txn['payment_status'] == payment_get_status_id('completed')) $paid = TRUE;to
The partial fix I posted about doesnt work without this edit.
Comment #2
simeassume not relevant with new code
Comment #3
(not verified) commented