Need help, because I am not familiar enough to help with the source code yet (but I'm learning).

I could not figure out why, but uc_roles_order hook is called a second time when I checkout using PayPal. But it does not do it when I checkout using a Money order for instance. So it might be IPN !?
This has for effect to proceed the role assignment as a 'renew' after a 'grant' or 'renew' was already called, which doubles the length of the role assignment and sends two role assignment confirmation emails to the customers (one before the invoice and the second 'renew' one after the invoice).

When I comment module_invoke_all('order', 'update', $order, $status); in uc_order_update_status (oc_order.module), both the calls go away, so it has to come from the order module.

Hopefully, you can reproduce this one on your side. I am running version 5.11 of Drupal with the latest version of all modules as of Oct 14, 2008. I also use the defaults provided in Workflow NG.

CommentFileSizeAuthor
#3 uc_roles_status_check.patch3.62 KBrszrama

Comments

FCX’s picture

- - - - - -
2008-10-16 update
Investigated further, function uc_order_action_update_status in ubercart/uc_order/uc_order_workflow.inc gets called twice, so problem is related to Workflow NG.

- - - - - -
2008-10-17 update
Might have found a way to resolve this issue. I have added a condition to Workflow rule : Update order status upon checkout completion with full payment

Condition added is : AND Check Order Status is NOT Completed

chadchandler’s picture

Great! Is there anyway you could go into your Workflow-NG admin panel, and export the Workflow and paste this code here so I can have a try? Thanks!

rszrama’s picture

Version: 5.x-1.5 » 5.x-1.6
Assigned: Unassigned » rszrama
Status: Active » Fixed
StatusFileSize
new3.62 KB

I fixed a similar issue in the files module a while back and just implemented the fix in the roles module. Patch attached, will be in the 1.7 release.

Chad_Dupuis’s picture

Status: Fixed » Active

I've applied this patch and I still see the same issues using Credit Card with Paypal Pro.

Do you also need the change to workflow-ng? or is there something else going on?

rszrama’s picture

Assigned: rszrama » Unassigned
cha0s’s picture

Assigned: Unassigned » cha0s
Status: Active » Postponed (maintainer needs more info)

Haven't got a test running yet, but I have to ask on the offchance, are you buying 2 of the product now and having the duration multiplied by the quantity? Doubt it, but it's worth a shot. Ryan's patch should work, as far as I can see.

Chad_Dupuis’s picture

No, my tests were for just one role membership. If I used the patch and the workflow changes everything seems fine and we've moved to production. The one thing I didn't test was whether or not the patch was even necessary - my guess is that it wasn't.

cha0s’s picture

Yeah, the patch does essentially what the wf-ng condition does. So, you shouldn't need to use both.

The point is, the code should be that way (post patch), so the condition shouldn't have been necessary in the first place. It's a workaround, but it should function the exact same as the patch.

I wasn't 100% sure reading your post, but did you mean that everything has been resolved? If so, the issue can be closed.

Chad_Dupuis’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Well I had to use the workflow rule to get it working. I tried the patch initially and it still didn't work. I guess that means the patch is not fully addressing the issue.

I'll close this for now, however, and hope that it is all set when 1.7 comes out.