Hello,

I have two ubercart set ups one on 1.6 and one recently upgraded to 1.7. On the 1.6 version I have role promotions working for both anonymous and logged in users. I have a patched version of uc_roles in 1.6 (one that was rolled into 1.7 - paypal duplicates..), but everything else is standard and it works.

I have a near identical site that I just upgraded to 1.7 and now role promotion only works for authenticated users. Anonymous users do not get a role even though the order status is marked appropriately and everything goes through.

Has anyone else run into this with the latest 1.7? Any ideas?

I have the same workflow settings and basically all of the same settings on both sites, so I cannot put my finger on why it isn't working and I'm afraid to upgrade the working site until I figure this out.

Thanks for any input!

Comments

Chad_Dupuis’s picture

Just curious if anyone can verify that this is working? I would appreciate a response particularly as everything works fine in my 1.6 instance....

Chad_Dupuis’s picture

Priority: Normal » Critical

As no one can confirm this either way, I can only assume that 1.7 is a serious bug, so I'm marking this as critical as there is functionality that may break on existing sites and certainly doesn't appear to be working on new ones.

rszrama’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

I just tested this on the Livetest with no issue. You can verify by purchasing the Uberfriend role. Roles here are set to apply on the "Completed" order status. This sounds like it may be a settings issue? If there is no actual bug here, we should close out this issue.

Chad_Dupuis’s picture

I've got all the settings identical, but I'll go through it again. I do seem to be having an issue with regular purchases (i.e. non role related) being stuck at payment received --- although the role purchases definitely went to completed. And, like I stated before, it all works well for authenticated users, just not the anonymous role.

I tried the livetest, but I cannot see if a role was granted, just that I got an account and the transaction went through (which happens on my site as well). Can you verify that the user yyhmsg actually received a role?

rszrama’s picture

If you login w/ that user, you should see a new block appear for the secret club or something. : P

Chad_Dupuis’s picture

sure enough, I see it thanks.... Well the only clue I have to go on is the strange behaviour of the shippable items being held at payment received even though the workflow rules have it the other way and the role promotion purchase does go to completed....

Could you by chance send me your workflow rules for the following two:
Update order status upon checkout completion with full payment
&
Update order status on full payment

Then I'll close this up...

rszrama’s picture

array (
  'uc_payment_received' => 
  array (
    '#type' => 'configuration',
    '#label' => 'Update order status on full payment',
    '#event' => 'payment_entered',
    '#module' => 'uc_payment',
    '#active' => true,
    0 => 
    array (
      '#type' => 'condition',
      '#name' => 'uc_payment_condition_balance',
      '#argument map' => 
      array (
        'order' => 'order',
      ),
      '#settings' => 
      array (
        'balance_comparison' => 'less_equal',
      ),
    ),
    1 => 
    array (
      '#type' => 'action',
      '#name' => 'uc_order_action_update_status',
      '#argument map' => 
      array (
        'order' => 'order',
      ),
      '#settings' => 
      array (
        'order_status' => 'payment_received',
      ),
    ),
    '#name' => 'uc_payment_received',
  ),
  'uc_checkout_complete_paid' => 
  array (
    '#type' => 'configuration',
    '#altered' => true,
    '#event' => 'checkout_complete',
    '#label' => 'Update order status upon checkout completion with full payment',
    '#module' => 'uc_payment',
    '#active' => true,
    '#id' => 1,
    0 => 
    array (
      '#type' => 'condition',
      '#name' => 'uc_payment_condition_balance',
      '#id' => 2,
      '#settings' => 
      array (
        'balance_comparison' => 'less_equal',
      ),
      '#argument map' => 
      array (
        'order' => 'order',
      ),
    ),
    1 => 
    array (
      '#id' => 3,
      '#negate' => true,
      '#type' => 'condition',
      '#name' => 'uc_order_condition_is_shippable',
      '#argument map' => 
      array (
        'order' => 'order',
      ),
    ),
    2 => 
    array (
      '#type' => 'action',
      '#name' => 'uc_order_action_update_status',
      '#id' => 5,
      '#settings' => 
      array (
        'order_status' => 'completed',
      ),
      '#argument map' => 
      array (
        'order' => 'order',
      ),
    ),
    '#name' => 'uc_checkout_complete_paid',
  ),
)
Chad_Dupuis’s picture

Are these from version 6? They look fairly different from my rules.....

If they are from 6, could you send the two rules from a working 5.x version? Thanks!

rszrama’s picture

These are 5.x, exported from Workflow-ng.

Chad_Dupuis’s picture

What version of workflow-ng are you using? some of my tables in the export view appear to have different names.......

I did have an extra check in Update order status upon checkout completion with full payment to for NOT already marked completed. Removing this seems to make it send the email saying the role was granted, but it still doesn't apply the role.... Any ideas?

Thanks for all the help!

rszrama’s picture

heh, So, I'm not really sure what more you're looking for. These rules are coming straight from Ubercart 1.7. It looks like the Livetest may have a slightly modified version of "Update order status upon checkout completion with full payment", but that's exactly what I've posted above.

Chad_Dupuis’s picture

I'm not sure either. All I know is that changing one insignificant aspect of a rule appears to have at least made the emails going out even though the role still isn't applied.... I'm just looking to make this work, perhaps in the wrong place, but the module itself seems fine and there seems to be some discrepancy in the rules at least.. Perhaps I'll have to start putting some tests in where the role should be getting applied and see what's going on...

Chad_Dupuis’s picture

To add a little, I noticed that in my rules I have something like:

'#active' => 1,
    0 => 

and both your site and the site that I have that is working have

'#active' => true

Perhaps I had run a dev version of workflow at one time, but this looks related somehow to this?? All my rules work, however -- flat rate shipping, sales tax, roles for registered users.... This is the only thing I can find that is different between the two sites...

rszrama’s picture

As far as PHP is concerned, 1 and true will be the same thing. For the site in question, are you using the latest UC w/ unmodified configurations? Are you using Wf-ng 2.1?

Chad_Dupuis’s picture

Yes, I have 1.7 - which was an upgrade from 1.6 (although I hadn't used the uc_roles functionality on this site). Everything is standard and workflow-ng is 5.x-2.1...

and I imported your roles from above so even the wording in workflow is the same. I did another test and got the role promotion letter, order marked as complete, new account created, etc. -- but no role applied...

I do get the role granted email and it has the correct order-id and user-id within the email. So when uc_roles is processed it has the right info. Something, however, is stopping it from applying the role....

Chad_Dupuis’s picture

We've been in production now for a bit and are still having issues with the roles getting assigned to anonymous users. I would really like to have some help debugging this.

What I've noticed is this:
The user checks out and they get the email saying their role was granted. When you look into the user profile it doesn't have the role selected but it does have the role chosen under role expirations with the right expiration date. You then have to add a role expiration to the same role (even though it says it has granted it, you can still select it, which you cannot after it has been properly applied) for the same time period. When you click save all is well.

Somewhere along the line it looks like it is missing a user save function of some sort?

mariuss’s picture

Just dropping a note that I am running into this issue with Drupal 6.

Registered users get their roles applied properly, but it does not work for anonymous users. For anonymous users the account is created, but:
1. the user is not logged in (and the corresponding checkbox is selected)
2. the role is not applied to the newly created account

univate’s picture

Issue tags: +uc_roles

I wonder if there is any connection here to my issue of not be able to apply more then one role on an order... (in fact it sounds like it might be)

#426084: Cannot add multiple roles on order

That issue is cause because the role gets assigned and then wiped again by another user_save() call

BenK’s picture

Status: Postponed (maintainer needs more info) » Active

I also have an issue with this on Ubercart-6.x-2.0-rc3.

I've got a use case where I'm trying to assign a role and offer a file download upon purchase of a product. While this works perfectly for authenticated users, it doesn't seem to work for anonymous users. Neither the role is assigned nor does the file show up as a download.

Interestingly, I've noticed that on the order confirmation screen where it usually prints out that the username has been granted a role, the role grant is printed but the username appears totally blank (even though a user account has been created for the anonymous user). This suggested to me that perhaps the user account is not yet created at the time it attempts to assign the role? This problem persists for anonymous users regardless of whether the anonymous user's e-mail address was matched up against an existing user account.

Also, the e-mail notifying users that role has been granted is actually being sent successfully (although the role is not actually granted). However, in the case of file downloads, the file download notification e-mail is not being sent at all.

I've also confirmed that the anonymous user is successfully being logged in upon completion of the order. (I have that option selected in the store configuration.) So I know the user account is being created properly.

Any thoughts? I've also created a new thread just for Drupal 6 users here:

http://drupal.org/node/479836

tr’s picture

Status: Active » Postponed (maintainer needs more info)

@BenK: Since you opened up a separate issue for your problem, I'm going to set the status of *this* issue back to where it was in #18.

longwave’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

It's too late to do anything with this now Drupal 5 is obsolete.