Skip to:
Content

BuddyPress.org

Opened 13 years ago

Closed 13 years ago

#4827 closed enhancement (fixed)

groups_create_group() doesn't set total_member_count

Reported by: rogercoathup Owned by: boonebgorges
Priority: normal Milestone: 1.8
Component: Groups Version: 1.7
Severity: minor Keywords: has-patch
Cc:

Description

Groups created programmatically with groups_create_group() do not show in the Group Directory.

If called without a creator_id, the function sets up a default creator, but does not set total_member_count to 1 in the group meta table.

As a result, subsequent calls to construct the BP_Groups_Template fail to include the groups.

Attachments (1)

4827.diff (458 bytes ) - added by ericlewis 13 years ago.

Download all attachments as: .zip

Change History (4)

#1 @boonebgorges
13 years ago

  • Component CoreGroups
  • Milestone Awaiting Review1.8
  • Severity normalminor
  • Type defect (bug)enhancement

It's always been this way, but I agree that it's kinda dumb. We should be doing this within the context of groups_create_group(). There shouldn't be backpat problems, because plugins currently doing it the old way will simply overwrite the total_member_count key.

@ericlewis
13 years ago

#2 @ericlewis
13 years ago

  • Keywords has-patch added

#3 @boonebgorges
13 years ago

  • Owner set to boonebgorges
  • Resolutionfixed
  • Status newclosed

In 7172:

Set initial group metadata in groups_create_group() rather than action function

Groups created through the user interface have two pieces of metadata set in
groups_action_create_group(): the total_member_count and the last_activity.
(Both items are needed for newly created groups to show up in directories.)
However, the placement of these groups_update_groupmeta() calls - in what is
essentially a controller function - meant that groups created programatically
using groups_create_group() did not have their complete metadata set. Moving
the metadata setting into groups_create_group() means one less step for plugins
and other scripts that create groups programatically.

Fixes #4827

Props ericlewis, rogercoathup

Note: See TracTickets for help on using tickets.