Skip to:
Content

BuddyPress.org

Opened 5 years ago

Closed 5 years ago

#8146 closed defect (bug) (fixed)

bp_get_group_is_public() always returns NULL

Reported by: mattjones2207's profile mattjones2207 Owned by: imath's profile imath
Milestone: 6.0.0 Priority: normal
Severity: normal Version: 1.0
Component: Groups Keywords: has-patch commit
Cc:

Description

It seems that the bp_get_group_is_public() function checks for $group->is_public property, but this does not exist in the BP_Groups_Group class.

Either this should be handled internally in the BP_Groups_Group class, or these functions should be checking the value of the $group->status property?

Also affected:

bp_group_is_public()
bp_get_group_public_status()
bp_group_public_status()

Attachments (2)

8146.patch (4.8 KB) - added by imath 5 years ago.
8146.2.patch (4.7 KB) - added by imath 5 years ago.

Download all attachments as: .zip

Change History (9)

#1 @imath
5 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 6.0.0
  • Version changed from 5.0.0 to 1.0

Hi @mattjones2207

Thanks for your feedback. There's a comment inside some of these functions saying there are not used anymore. But I agree we should deprecate them asap.

To get the group status from within a groups loop, you can use bp_get_group_status( $group ) to know if it's a public one you should be able to do 'public' === bp_get_group_status( $group )

@imath
5 years ago

#2 @imath
5 years ago

  • Keywords has-patch added; needs-patch removed

8146.patch is deprecating the functions.

#3 @mattjones2207
5 years ago

Thanks @imath! I did stumble across the bp_get_group_status() function in the end :)

#4 @espellcaste
5 years ago

@imath Another easy win for 6.0 which I think it is ready to be commited.

#5 @imath
5 years ago

  • Keywords needs-refresh added

Sure but now I've created a deprecated/6.0.php file for #8156 The patch needs a refresh.

@imath
5 years ago

#6 @imath
5 years ago

  • Keywords commit added; needs-refresh removed

Patch has been refreshed. Let's commit it.

#7 @imath
5 years ago

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

In 12568:

Groups: deprecate 4 functions no more used in BuddyPress

Deprecated functions are:

  • bp_group_public_status()
  • bp_get_group_public_status()
  • bp_group_is_public()
  • bp_get_group_is_public()

Props mattjones2207, espellcaste

Fixes #8146

Note: See TracTickets for help on using tickets.