Skip to:

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#3414 closed defect (bug) (fixed)

Undefined index in BuddyBar

Reported by: r-a-y's profile r-a-y Owned by:
Milestone: 1.5 Priority: normal
Severity: normal Version: 1.5
Component: Core Keywords: has-patch reporter-feedback


Attached patch addresses two undefined index notices in the BuddyBar.

Attachments (1)

3414.01.patch (3.3 KB) - added by r-a-y 13 years ago.

Download all attachments as: .zip

Change History (7)

13 years ago

#1 @r-a-y
13 years ago

Forgot to add that these notices appear when you're not logged in.

#2 @boonebgorges
13 years ago

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

(In [4904]) Avoid PHP notices in bp_core_remove_nav_item() and bp_core_remove_subnav_item(). Fixes #3414. Props r-a-y

#3 @DJPaul
13 years ago

  • Keywords reporter-feedback added
  • Milestone changed from Awaiting Review to 1.5
  • Resolution fixed deleted
  • Status changed from closed to reopened

Which part of the menu or item causes these? Is masking these errors cloaking a bug somewhere else?

#4 @boonebgorges
13 years ago

We don't use bp_core_remove_nav_item() internally, and we only use bp_core_remove_subnav_item() in an isolated incident where such a PHP notice would not arise. We provide them as convenience functions for plugin authors. And since the functions both take arbitrary string arguments, it's possible that the situation will arise where these isset() checks will be necessary.

I'm assuming r-a-y was testing with some plugins that use the functions. r-a-y, can you confirm one way or the other?

In any case, it's hard to see how these notices would signify any deeper problem in BP, since, as I say above, we don't use them.

#5 @akash_bug
13 years ago

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

I don't see any problem in BP bar......some plugin may be causing the problem...

#6 @r-a-y
13 years ago

Boone is right on the money; I had a small piece of code that was using bp_core_remove_subnav_item().

Full piece of offending code:

bp_core_remove_subnav_item( $bp->activity->slug, 'mentions' );

I guess I can check if the user is logged in before trying to remove the subnav item. That will fix the problem.

I think the patch does no harm though, as there might be people like me that might forget ;)
You can revert though if you want.

Last edited 13 years ago by r-a-y (previous) (diff)
Note: See TracTickets for help on using tickets.