Skip to:
Content

BuddyPress.org

Opened 14 years ago

Closed 10 years ago

Last modified 10 years ago

#4986 closed defect (bug) (fixed)

bp_nav_menu activity favorite filter selection clash with bbPress favorites

Reported by: hnla Owned by: boonebgorges
Priority: normal Milestone: 2.9
Component: Core Version: 1.7
Severity: normal Keywords: has-patch
Cc: hnla, karmatosed@…, mercijavier@…

Description

There could be a potential issue with bbPress grabbing / hijacking the favourites submenu.

Clicking Activity > Favourites has the effect of setting the forum parent li element to the class 'current-menu-parent' where only the activity li element should have this. Result in my implementation is the submenu elements are overwriting the activity submenu items due to the class on forums li set to 'current-menu-parent'

For reference wp_nav_menus discussed and added in #4629

Attachments (6)

Screen Shot 2013-07-16 at 2.38.41 PM.png​ (187.7 KB ) - added by johnjamesjacoby 13 years ago.
bp-nav-menu-ok.jpg​ (27.6 KB ) - added by hnla 13 years ago.
menu view normal
bp-nav-menu-borked.jpg​ (30.1 KB ) - added by hnla 13 years ago.
menu view broken
bp-nav-menu-html.jpg​ (161.0 KB ) - added by hnla 13 years ago.
menu markup view showing current item classes
bp-nav-menu-html.2.jpg​ (161.0 KB ) - added by hnla 13 years ago.
menu markup expanded
4986.diff​ (873 bytes ) - added by lakrisgubben 10 years ago.

Download all attachments as: .zip

Change History (21)

#1 @johnjamesjacoby
13 years ago

  • Keywords reporter-feedback needs-patch added; 2nd-opinion removed
  • Milestone Awaiting Review → 1.8.1

This looks okay to me. If I'm incorrect regarding which menu you're speaking of, can you include a screenshot to help identify the issue?

#2 follow-up: @hnla
13 years ago

If I'm incorrect regarding which menu you're speaking of

It's the newish bp_nav_menu() so isn't in general use so far as it needs to be implemented in templates to replace old object nav

You would need to do:

<div id="item-nav">
  <div class="item-list-tabs no-ajax" id="object-nav" role="navigation">
    <?php bp_nav_menu(); ?>
  </div>
</div>

In /members/home.php & removing the subnav calls

I ran up a set of template files & styles when I was test implementing the menu which can be used if easier:

​https://github.com/hnla/hnla-bp-nav-menu/tree/master

The issue is then as described in opening ticket selecting activity>friends would set that link to 'current' but forums link also receives the class 'current' causing issues with styles.

@hnla
13 years ago

menu markup view showing current item classes

#3 in reply to: ↑ 2 @johnjamesjacoby
13 years ago

Replying to hnla:

It's the newish bp_nav_menu() so isn't in general use so far as it needs to be implemented in templates to replace old object nav

This is helpful, and I confirmed it just now.

We use this on buddypress.org, and you can see it happen on your own profile.

#4 @johnjamesjacoby
13 years ago

  • Keywords reporter-feedback removed
  • Milestone 1.8.1 → 1.9

Moving to 1.9, so we can lump this in with other navigation API updates. Related to #5103.

#5 @hnla
13 years ago

We use this on buddypress.org, and you can see it happen on your own profile.

Ah yes, just had a look, never realised it was in use anywhere :)

#6 @karmatosed
13 years ago

  • Cc karmatosed@… added

#7 @boonebgorges
13 years ago

  • Milestone 1.9 → Future Release

#8 @mercime
13 years ago

  • Cc mercijavier@… added

#9 @lakrisgubben
10 years ago

  • Keywords has-patch added; needs-patch removed

The problem is that the current implementation of bp_get_nav_menu_items only checks if the submenu slug is the same as bp_current_action which leads to false positives if two different components have submenus that use the same slug (like favorites). The attached patch fixes this by also checking that the parent menu item has the same slug as the current component.

#10 @hnla
10 years ago

  • Milestone Future Release → Awaiting Review

Thanks for patch, lets review and fix for 2.9, be nice to close out a four year old ticket. :)

#11 @hnla
10 years ago

  • Milestone Awaiting Review → 2.9

#12 @netweb
10 years ago

  • Summary bp_nav_menu avtivity favourit filter selection clash with bbPress favourits → bp_nav_menu activity favorite filter selection clash with bbPress favorites

#13 @boonebgorges
10 years ago

@lakrisgubben Good catch! Fix looks right to me.

#14 @boonebgorges
10 years ago

  • Owner set to boonebgorges
  • Resolution → fixed
  • Status new → closed

In 11518:

Better current-item determination in bp_nav_menu().

Current component *and* action should both be matched when
determining current item, so as to avoid clashes when two
top-level items have children by the same name.

Props lakrisgubben.
Fixes #4986.

This ticket was mentioned in ​Slack in #buddypress by hnla. ​View the logs.


10 years ago

Note: See TracTickets for help on using tickets.