Line 38 in og_ui_subscribe reads:
$field_name = og_get_best_group_audience_field('user', $user->uid, $entity_type, $bundle);

og_get_best_group_audience_field takes $entity as second parameter, not id.
corrected to:
$field_name = og_get_best_group_audience_field('user', $user, $entity_type, $bundle);

Patch will follow.

Comments

rv0’s picture

Status: Active » Needs review
StatusFileSize
new631 bytes
amitaibu’s picture

Status: Needs review » Needs work
+++ b/og_ui/og_ui.pages.inc
@@ -35,7 +35,7 @@ function og_ui_subscribe($entity_type, $etid, $field_name = NULL) {
+    $field_name = og_get_best_group_audience_field('user', $user, $entity_type, $bundle);

Instead of passing the global $user, can you pass an $account (where $account = user_load(...

rv0’s picture

Status: Needs work » Needs review
StatusFileSize
new1.04 KB

Account was defined a bit further down, so changed it to be defined earlier.

ranroz’s picture

Tested and seems OK.

amitaibu’s picture

Status: Needs review » Fixed

Committed, thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.