[buddypress-trac] [BuddyPress Trac] #8005: Reset() expects parameter 1 to be and array, boolean given - buddypress/bp-core/bp-core-template.php 3038
buddypress-trac
noreply at wordpress.org
Wed Nov 21 12:35:03 UTC 2018
#8005: Reset() expects parameter 1 to be and array, boolean given - buddypress/bp-
core/bp-core-template.php 3038
--------------------------+-----------------------------
Reporter: Venutius | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Core | Version: 3.0.0
Severity: normal | Keywords:
--------------------------+-----------------------------
I've been getting the following error in my logs:
reset() expects parameter 1 to be array, boolean given
Type: PHP Warning
Line: 3038
File: /wp-content/plugins/buddypress/bp-core/bp-core-template.php
Line 3038 has:
{{{
#!python
if ( ! empty( $bp->members->nav ) ) {
$primary_nav_item = $bp->members->nav->get_primary( array( 'slug'
=> $component_id ), false );
$primary_nav_item = reset( $primary_nav_item );
}
}}}
I had a play and one way of dealing with the issue could be:
{{{
#!python
if ( ! empty( $bp->members->nav ) ) {
$primary_nav_item = $bp->members->nav->get_primary( array( 'slug'
=> $component_id ), false );
$primary_nav_item = reset( $arr = array($primary_nav_item) );
}
}}}
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8005>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list