Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 8 years ago

Last modified 8 years ago

#4986 closed defect (bug) (fixed)

bp_nav_menu activity favorite filter selection clash with bbPress favorites

Reported by: hnla's profile hnla Owned by: boonebgorges's profile boonebgorges
Milestone: 2.9 Priority: normal
Severity: normal Version: 1.7
Component: Core 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 11 years ago.
bp-nav-menu-ok.jpg (27.6 KB) - added by hnla 11 years ago.
menu view normal
bp-nav-menu-borked.jpg (30.1 KB) - added by hnla 11 years ago.
menu view broken
bp-nav-menu-html.jpg (161.0 KB) - added by hnla 11 years ago.
menu markup view showing current item classes
bp-nav-menu-html.2.jpg (161.0 KB) - added by hnla 11 years ago.
menu markup expanded
4986.diff (873 bytes) - added by lakrisgubben 8 years ago.

Download all attachments as: .zip

Change History (21)

#1 @johnjamesjacoby
11 years ago

  • Keywords reporter-feedback needs-patch added; 2nd-opinion removed
  • Milestone changed from Awaiting Review to 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
11 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
11 years ago

menu view normal

@hnla
11 years ago

menu view broken

@hnla
11 years ago

menu markup view showing current item classes

@hnla
11 years ago

menu markup expanded

#3 in reply to: ↑ 2 @johnjamesjacoby
11 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
11 years ago

  • Keywords reporter-feedback removed
  • Milestone changed from 1.8.1 to 1.9

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

#5 @hnla
11 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
11 years ago

  • Cc karmatosed@… added

#7 @boonebgorges
11 years ago

  • Milestone changed from 1.9 to Future Release

#8 @mercime
11 years ago

  • Cc mercijavier@… added

#9 @lakrisgubben
8 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.

@lakrisgubben
8 years ago

#10 @hnla
8 years ago

  • Milestone changed from Future Release to Awaiting Review

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

#11 @hnla
8 years ago

  • Milestone changed from Awaiting Review to 2.9

#12 @netweb
8 years ago

  • Summary changed from bp_nav_menu avtivity favourit filter selection clash with bbPress favourits to bp_nav_menu activity favorite filter selection clash with bbPress favorites

#13 @boonebgorges
8 years ago

@lakrisgubben Good catch! Fix looks right to me.

#14 @boonebgorges
8 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to 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.


8 years ago

Note: See TracTickets for help on using tickets.