[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
Fri Dec 28 19:02:52 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 Contributions
Component:  Navigation      |     Version:  3.0.0
 Severity:  normal          |  Resolution:
 Keywords:  good-first-bug  |
----------------------------+-------------------------------------

Comment (by klawton):

 Hello, I've been getting the same error with my project so I added a check
 to make sure $primary_nav_item is not false which seems to be working for
 me. I replaced
 {{{
 $primary_nav_item = $bp->members->nav->get_primary( array( 'slug' =>
 $component_id ), false );
 $primary_nav_item = reset( $primary_nav_item );
 }}}
 with
 {{{
 $primary_nav_item = $bp->members->nav->get_primary( array( 'slug' =>
 $component_id ), false );
 $primary_nav_item = $primary_nav_item ? reset( $primary_nav_item ) :
 $primary_nav_item;
 }}}
 My first time contributing here so if there is a better place to put fixes
 i'll be happy to repost there.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8005#comment:4>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list