Opened 8 years ago
Closed 8 years ago
#7203 closed defect (bug) (fixed)
BP_Core_Nav->delete_nav() generates "Array to string conversion" PHP Notice
Reported by: | needle | Owned by: | imath |
---|---|---|---|
Milestone: | 2.7 | Priority: | normal |
Severity: | normal | Version: | 2.6.0 |
Component: | Navigation | Keywords: | has-patch |
Cc: |
Description
When deleting a parent nav item whose "screen function" (callback) is a method rather than a function, array_unique
generates a PHP Notice: "Array to string conversion in /wp-content/plugins/buddypress/bp-core/classes/class-bp-core-nav.php on line 278". I can't quite figure out the importance of returning a unique array, since there seems to be no down side to unhooking any returned callbacks multiple times. IOW, unhooking an already-unhooked callback will have no effect.
Attachments (2)
Change History (7)
#3
@
8 years ago
- Keywords has-patch added
If the install is PHP 5.2.9+, we could use the second parameter to array_unique()
:
http://php.net/manual/en/function.array-unique.php
Maybe we can make this change for BP 2.8 when we will support PHP 5.3+.
Or, we can do what @needle recommended and that is to remove the array_unique()
call for now.
Hi @needle
Thanks for your feedback.
You're probably right. I need to have a look at it more carefully. We could also serialize/unserialize. See attached patch.