Download & Extend

Determine unapproved members is being done incorrectly

Project:Organic Group Statistics
Version:6.x-1.0-rc5
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs work

Issue Summary

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

#1

Status:active» needs review

Patch

AttachmentSizeStatusTest resultOperations
og_statistics-proper-determination-of-unapproved-1162928.patch1.13 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch og_statistics-proper-determination-of-unapproved-1162928.patch.View details | Re-test

#2

Status:needs review» needs work

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

#3

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

AttachmentSizeStatusTest resultOperations
og_statistics-proper-determination-of-unapproved-1162928.patch909 bytesIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch og_statistics-proper-determination-of-unapproved-1162928_0.patch.View details | Re-test

#4

Status:needs work» needs review

#5

Status:needs review» needs work

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

#6

Jeez..what am I missing?

#7

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?
nobody click here