Skip to:

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#7916 closed defect (bug) (fixed)

Warning after deleting xprofile fields group

Reported by: djanym's profile djanym Owned by: boonebgorges's profile boonebgorges
Milestone: 3.2.0 Priority: normal
Severity: normal Version: 3.0.0
Component: Core Keywords:


When removing a custom xprofile fields group - it deletes, but also throwing this warning:
Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/wp/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-group.php on line 214

Change History (4)

#1 @boonebgorges
6 years ago

  • Milestone changed from Awaiting Review to 3.2.0

Just came across this myself. Let's fix in the branch.

#2 @boonebgorges
6 years ago

So, as far as I can see, this code does nothing. It appears that the fields property of a BP_XProfile_Group object is never populated. In BP_XProfile_Group::get(), the fields property of each group object is populated, but these are stdClass objects, not BP_XProfile_Group. So it's not really possible to write a test that demonstrates the functionality. I'm going to throw an empty() check in front of it, to squelch the error.

#3 @boonebgorges
6 years ago

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

In 12210:

Prevent notices on PHP 7.2 when deleting xprofile groups.

Fixes #7916.

#4 @boonebgorges
6 years ago

In 12211:

Prevent notices on PHP 7.2 when deleting xprofile groups.

Merges [12210] to the 3.0 branch.

Fixes #7916.

Note: See TracTickets for help on using tickets.