I'm having a very hard time understanding the logic behind determining an unapproved member in hook_og().

      // If not a moderated group, update the membership count,
      // or if it is a moderated group and unapproved users are to be counted,
      // then update the statistics.
      if ($node->og_selective != 1 || ($node->og_selective == 1 && variable_get('og_statistics_include_unapproved_members', TRUE))) {

Well first, the constant OG_MODERATED should be used instead of the value 1.

And the group selective setting is irrelevant when it comes to determining if a user is approved or not. In order to do that, you check the $args for $args['is_active'] == 1.

Patch coming

Comments

mstef’s picture

Status: Active » Needs review
StatusFileSize
new1.13 KB

Patch

Status: Needs review » Needs work

The last submitted patch, og_statistics-proper-determination-of-unapproved-1162928.patch, failed testing.

mstef’s picture

Repatched against what's in git right now.. should work..

mstef’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, og_statistics-proper-determination-of-unapproved-1162928.patch, failed testing.

mstef’s picture

Jeez..what am I missing?

dawehner’s picture

13:03:07] Command [git apply -p1 --check /var/lib/drupaltestbot/sites/default/files/review/og_statistics-proper-determination-of-unapproved-1162928_0.patch 2>&1] failed
  Duration 0 seconds
  Directory [/var/lib/drupaltestbot/sites/default/files/checkout/sites/default/modules/og_statistics]
  Status [1]
 Output: [error: patch failed: og_statistics.module:168
error: og_statistics.module: patch does not apply].
[13:03:07] Command [git apply -p0 --check /var/lib/drupaltestbot/sites/default/files/review/og_statistics-proper-determination-of-unapproved-1162928_0.patch 2>&1] failed
  Duration 0 seconds
  Directory [/var/lib/drupaltestbot/sites/default/files/checkout/sites/default/modules/og_statistics]
  Status [1]
 Output: [error: a/og_statistics.module: No such file or directory].
[13:03:07] Encountered error on [apply], details:
array (

Both command's does not work.
Are you sure that the patch applies against the dev version?