#7916 closed defect (bug) (fixed)
Warning after deleting xprofile fields group
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 3.2.0 | Priority: | normal |
| Severity: | normal | Version: | 3.0.0 |
| Component: | Core | Keywords: | |
| Cc: |
Description
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)
#2
@
7 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.
Just came across this myself. Let's fix in the branch.