[buddypress-trac] [BuddyPress] #4794: Calling bp_core_new_nav_item() without screen_function parameter generates PHP warning

buddypress-trac noreply at wordpress.org
Tue Jan 29 23:42:20 UTC 2013


#4794: Calling bp_core_new_nav_item() without screen_function parameter generates
PHP warning
-------------------------+-------------------------------------------------
 Reporter:  doublesharp  |      Owner:
     Type:  defect       |     Status:  new
  (bug)                  |  Milestone:  Awaiting Review
 Priority:  normal       |    Version:  1.6
Component:               |   Keywords:  has-patch dev-feedback needs-
  Warnings/Notices       |  testing
 Severity:  normal       |
-------------------------+-------------------------------------------------
 Adding a new navigation item via bp_core_new_nav_item() without passing
 {{{screen_function}}} as a parameter (if it uses a default subnav screen
 for example) will generate the following warning when
 {{{do_action('bp_screens');}}} is called:

 {{{
 [29-Jan-2013 23:21:55 UTC] PHP Warning:  call_user_func_array() expects
 parameter 1 to be a valid callback, no array or string given in
 /Workspaces/PHP/wordpress/wp-includes/plugin.php on line 406
 }}}

 Changing the default value for this parameter in {{{bp-core/bp-core-
 buddybar.php}}} from {{{false}}} to {{{'__return_false'}}} uses a valid
 callback and does not generate the warning.

 The same fix can be applied to {{{bp_core_new_subnav_item()}}},
 {{{bp_core_new_nav_item()}}}, and {{{bp_core_new_nav_default()}}} asin the
 attached patch.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4794>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list