Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#4302 closed defect (bug) (fixed)

bp_get_loggedin_user_nav() uses undefined key ( on file bp-members-template.php)

Reported by: rbahumi's profile rbahumi Owned by:
Milestone: 1.6 Priority: normal
Severity: minor Version:
Component: Members Keywords:
Cc:

Description

Hi,

When I navigated to the 'Home' page at my local BuddyPress installation (I am working in DEBUG mode), I received and 'Notice' message regarding an undefined key.

Make a long story short - the '$bp->current_component' is not defined for regular pages, and the bp_get_loggedin_user_nav() function (line 710) doesn't check that:

if ( !bp_is_directory() && $bp->active_components[$bp->current_component] == $nav_item['css_id'] ){

So, I've added another check to the 'if' statement:

if ( !bp_is_directory() && !empty( $bp->current_component ) && $bp->active_components[$bp->current_component] == $nav_item['css_id'] ){

Attachments (1)

bp-members-template.php (36.3 KB) - added by rbahumi 12 years ago.
This is the file after my small change

Download all attachments as: .zip

Change History (6)

@rbahumi
12 years ago

This is the file after my small change

#1 @boonebgorges
12 years ago

  • Milestone changed from Awaiting Review to 1.6

bp_get_loggedin_user_nav() is not used anymore in BP core, which is why we've never noticed :) It must be called in your custom theme. But this is a fine fix.

#2 @boonebgorges
12 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [6152]) Check that an array key is set before accessing in bp_get_loggedin_user_nav()

Fixes #4302

Props rbahumi

#3 @rbahumi
12 years ago

Hi@boonebgorges,

Just downloaded the last BuddyPress release, and I still see the issue.

I am not familiar with your way of work, but this issue is reported as fixed both here, and on the 6152...

Does "fixed" means that the only the next update will include this change?

Thanks,
Roei

#4 @boonebgorges
12 years ago

'fixed' means that the fix has been put into our source code repository. In this case, the fix was placed into the 'trunk', or the development version of the software. This will be available in the official release as of version 1.6. If you don't want to wait, you can download the latest bleeding-edge version of the trunk by using Subversion:

svn co http://buddypress.trac.wordpress.org/trunk /local/path/to/wordpress/wp-content/plugins/buddypress/

#5 @rbahumi
12 years ago

Just wanted a clarification in that.

Thank you for your quick response.
Roei.

Version 0, edited 12 years ago by rbahumi (next)
Note: See TracTickets for help on using tickets.