Skip to:
Content

BuddyPress.org

Opened 11 years ago

Closed 11 years ago

#5269 closed defect (bug) (fixed)

Notice error in bp_get_group_join_button() for non members of private groups

Reported by: imath's profile imath Owned by: boonebgorges's profile boonebgorges
Milestone: 1.9 Priority: normal
Severity: minor Version: 1.8.1
Component: Groups Keywords: has-patch
Cc:

Description

Actually, the problem doesn't exist in 1.8.1. This is something i've only noticed in 1.9-beta1

If a group is private, then if the logged in user is not a member of this group, in the groups directory, bp_get_group_join_button() causes a notice error as $group->is_invited is not defined.

I suggest the diff attached (simply adds an isset check)

Attachments (1)

5269.diff (897 bytes) - added by imath 11 years ago.

Download all attachments as: .zip

Change History (3)

@imath
11 years ago

#1 @boonebgorges
11 years ago

  • Milestone changed from Awaiting Review to 1.9

Good catch.

The suggestion in 5269.diff is a workaround for the fact that the properties aren't set correctly in the first place. I think I'd rather fix the root issue.

#2 @boonebgorges
11 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 7616:

Refactor get_group_extras logic in group loops

The previous logic made it so that is_pending, is_invited, and is_member
values were only set in the case where users had a membership for the group
in the database. This could result in PHP warnings in certain cases, and in
all cases results in inconsistent data structures between member and non-member
groups within group loops.

Fixes #5269

Note: See TracTickets for help on using tickets.