The user is not added to the organic group when purchasing a product with an anonymous user.
(user account for anonymous user is created at order completion).

License
The License that is created seems ok, it correctly states the right user and the right organic group.
But the organic group doesn't have the user as a member.

Tested the same anonymous case with commerce_license_file: that works fine, so it seems to be a problem specifically related to organic groups.

Note
This works fine with logged-in user checkout, just not with anonymous users.

Test environment:
Used the setup from the documentation at https://www.drupal.org/node/2366023.
fresh Drupal 7.32 install and these modules:
(all latest stable versions)

commerce 7.x-1.10
views 7.x-3.8
rules 7.x-2.7
ctools 7.x-1.4
addressfield 7.x-1.0-beta5
entity_bundle_plugin 7.x-1.0-beta2 (also tested with 7.x-1.x-dev 2013-Sep-30)
advancedqueue 7.x-1.0-beta3
inline_entity_form 7.x-1.5
commerce_license 7.x-1.3
og 7.x-2.7 (also tested with 7.x-2.x-dev 2014-Oct-25)
commerce_license_og 7.x-1.x-dev
views_bulk_operations 7.x-3.2

Possibly related
Not sure if this is related to #2366151: OG Licenses causing warnings at Store -> Licenses page

Comments

Kazanir’s picture

Yeah, I'm not sure what's going on here. I will try to replicate but as far as I can tell, og_group() isn't doing what it is supposed to for some reason (when called within CommerceLicenseOg::verifyGroupMembership) and I cannot suss out why. I'll keep looking at it.