Skip to:
Content

BuddyPress.org

Opened 5 years ago

Closed 5 years ago

#8152 closed defect (bug) (fixed)

BuddyPress Blocks category may cause an error

Reported by: imath's profile imath Owned by: imath's profile imath
Milestone: 5.1.0 Priority: normal
Severity: normal Version: 5.0.0
Component: Administration Keywords:
Cc:

Description

In this topic https://buddypress.org/support/topic/since-update-to-5-0-buddypress-freezes-features-of-wordpress-backend/ "chickencurry" reported an error involving the function that is adding the BuddyPress blocks category.

I guess the type needs to be more permissive to avoid it. See attached patch.

Attachments (1)

8152.patch (821 bytes) - added by imath 5 years ago.

Download all attachments as: .zip

Change History (3)

@imath
5 years ago

#1 @imath
5 years ago

In 12490:

Edit the type of the bp_block_category() function's second argument

Although this filter should always get a WP_Post as a second argument, it appears there is a risk this function is used directly passing a null value as the second argument. See this support topic.

To prevent this risk of notice error, we are making sure the second argument is a WP_Post in a different way.

See #8152 (Trunk)

#2 @imath
5 years ago

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

In 12491:

Edit the type of the bp_block_category() function's second argument

Although this filter should always get a WP_Post as a second argument, it appears there is a risk this function is used directly passing a null value as the second argument. See this support topic.

To prevent this risk of notice error, we are making sure the second argument is a WP_Post in a different way.

Fixes #8152 (Branch 5.0)

Note: See TracTickets for help on using tickets.