Skip to:
Content

BuddyPress.org

Opened 8 years ago

Closed 8 years ago

#4577 closed defect (bug) (fixed)

[bp-groups][bp-groups-template.php] bp_get_group_join_button() Line: 1524

Reported by: michael.ecklund Owned by: Michael Ecklund
Milestone: 1.7 Priority: normal
Severity: normal Version: 1.6.1
Component: Groups Keywords: has-patch
Cc: info@…, jkudish

Description

Notice: Undefined property: stdClass::$is_member in /wp-content/plugins/buddypress/bp-groups/bp-groups-template.php on line 1524

Upon passing in the "normal" group data object to the parameter $group for the function bp_get_group_join_button($group) defined at line: 1510

Which consists of:

stdClass Object
(
    [id] => 2824
    [creator_id] => 481
    [name] => Air Force W4
    [slug] => air-force-w4
    [description] => Group description...
    [status] => public
    [enable_forum] => 1
    [date_created] => 2012-10-02 19:20:48
)

It's checking for a portion of the object which doesn't exist, causing an error....

Line: 1524 = if ( $group->is_member ) {

Attachments (1)

4577.diff (482 bytes) - added by jkudish 8 years ago.
prevent php notice in bp_get_group_join_button

Download all attachments as: .zip

Change History (4)

@jkudish
8 years ago

prevent php notice in bp_get_group_join_button

#1 @jkudish
8 years ago

  • Cc jkudish added
  • Keywords has-patch added; needs-patch removed

#2 @boonebgorges
8 years ago

  • Milestone changed from Awaiting Review to 1.7

#3 @boonebgorges
8 years ago

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

(In [6420]) Avoid PHP error when checking whether user is a group member.

Fixes #4577

Props jkudish

Note: See TracTickets for help on using tickets.