Skip to:

Opened 10 years ago

Closed 10 years ago

#5871 closed defect (bug) (fixed)

bp_get_the_post_class() can generate an error if the groups component is deactivated

Reported by: imath's profile imath Owned by: imath's profile imath
Milestone: 2.1 Priority: normal
Severity: normal Version: 1.2
Component: Core Keywords: has-patch commit


I think it's an edge case, but as it happened to me, i guess it can happen to someone else ;)

Steps to reproduce :

  1. Activate the groups component,
  2. Deactivate it
  3. go to site.url/groups (the page exists as it was created at step 1)

Fatal error due to bp_is_group() check at line 2451 of bp-core-template.php

In bp_is_group() problem is due to the use of groups_get_current_group()

I think we should use bp_is_active( 'groups' ) in the bp_is_group() function before trying to get the current group. See attached patch.

Attachments (1)

5871.patch (597 bytes) - added by imath 10 years ago.

Download all attachments as: .zip

Change History (3)

10 years ago

#1 @r-a-y
10 years ago

  • Keywords commit added

Good catch, imath! I'd say this is commit-worthy.

#2 @imath
10 years ago

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

In 9002:

In bp_is_group(), make sure Groups component is active before trying to get current group.

In case the groups component has been deactivated, as the WordPress page still exists, there is a possibility the Groups page is displayed. In that case, this commit prevents an error.

Fixes #5871

Note: See TracTickets for help on using tickets.