Skip to:
Content

BuddyPress.org

Opened 6 years ago

Closed 3 years ago

Last modified 2 years ago

#4986 closed defect (bug) (fixed)

bp_nav_menu activity favorite filter selection clash with bbPress favorites

Reported by: hnla Owned by: 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 6 years ago.
bp-nav-menu-ok.jpg (27.6 KB) - added by hnla 6 years ago.
menu view normal
bp-nav-menu-borked.jpg (30.1 KB) - added by hnla 6 years ago.
menu view broken
bp-nav-menu-html.jpg (161.0 KB) - added by hnla 6 years ago.
menu markup view showing current item classes
bp-nav-menu-html.2.jpg (161.0 KB) - added by hnla 6 years ago.
menu markup expanded
4986.diff (873 bytes) - added by lakrisgubben 3 years ago.

Download all attachments as: .zip

Change History (21)

#1 @johnjamesjacoby
6 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
6 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
6 years ago

menu view normal

@hnla
6 years ago

menu view broken

@hnla
6 years ago

menu markup view showing current item classes

@hnla
6 years ago

menu markup expanded

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

  • Cc karmatosed@… added

#7 @boonebgorges
6 years ago

  • Milestone changed from 1.9 to Future Release

#8 @mercime
6 years ago

  • Cc mercijavier@… added

#9 @lakrisgubben
3 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
3 years ago

#10 @hnla
3 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
3 years ago

  • Milestone changed from Awaiting Review to 2.9

#12 @netweb
3 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
3 years ago

@lakrisgubben Good catch! Fix looks right to me.

#14 @boonebgorges
3 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.


2 years ago

Note: See TracTickets for help on using tickets.