I'm not sure if this is related to your post about a fix, but after extensive testing I find the following, which may be helpful. The issue that I am asking about has nothing to do, as far as I can tell, with CB Fields actions on deactivation. We have disabled all of those for the purpose of testing this issue. We only have CB Fields set to act on activation.
Here is what I have found:
First time user subscribes and chooses offline payment (payment basket pending), CB Fields for the plan ARE NOT triggered until AFTER the payment basket is processed as paid
If the user renews the subscription while it is still active and chooses offline payment (payment basket pending), CB Fields ARE triggered immediately, BEFORE the payment basket is processed as paid. When the payment basket is processed as paid, CB Fields are triggered AGAIN. In the case of a field where the action is to add +1 to the integer, it is therefore added twice: once when offline payment (payment basket pending) is selected and then again when the pending basket is processed as paid.
It is the same result if the subscription is unsubscribed from the backend and the user chooses to resubscribe and chooses offline payment (payment basket pending). CB Fields ARE triggered immediately, BEFORE the payment basket is processed as paid. When the payment basket is processed as paid, CB Fields are triggered AGAIN. In the case of a field where the action is to add +1 to the integer, it is therefore added twice: once when offline payment (payment basket pending) is selected and then again when the pending basket is processed as paid.
however, if the user's subscription is DELETED from the User Management backend, then when they resubscribe and choose to pay offline (payment basket pending), CB Fields are NOT triggered until the payment is processed as paid...
This is made worse when the user selects the plan that they have already initiated an offline payment for (but has not yet been processed as paid yet) and they once again select offline payment, creating a 2nd payment pending basket (this is related to my post
www.joomlapolis.com/forum/255-developer-members-support/244033-8568-disable-renew-payment-button-when-payment-pending
[#8568] Disable renew/payment button when payment pending
). The CB Fields are triggered as activated each time they initiate an offline payment. If they do it 5 times before a pending basket is processed as paid, CB Fields are triggered as activation 5 times.
The final straw is that the warning message on the payment page:
'A_PAYMENT_BASKET_IS_PENDING_IN_PROGRESS_FOR_PAYMEN_adc904' => 'There is already a payment in process for your membership. Only select a payment option below if you want to change the method by which you will pay your membership fee',
only shows up on rare and fleeting occasions. I see it once in a while when clicking a subscription payment/renewal button but mostly it does NOT display when the situation would seem that the message should in fact show up. That is, when a pending payment already exists for that subscription.
Any advice or guidance you may have would be greatly appreciated. And if you think that the bug you have identified and the fix will address the issues above then we look forward to that fix.