Skip to:
Content

BuddyPress.org

Opened 3 years ago

Closed 3 years ago

#8471 closed defect (bug) (fixed)

bp_core_new_nav_default() function is useless

Reported by: imath's profile imath Owned by: imath's profile imath
Milestone: 10.0.0 Priority: normal
Severity: normal Version: 2.6.0
Component: Core Keywords: has-patch commit
Cc:

Description

Reviewing 8139.current-action.patch about #8139 I've found, using bp_core_new_nav_default() function is making the BP Component hardcoded Default subnav unusable.

To reproduce, add a new bp-custom.php file with this code:

function bp_activity_component_new_default_subnav() {
	bp_core_new_nav_default(
		array(
			'parent_slug'     => bp_get_activity_slug(),
			'screen_function' => 'bp_activity_screen_mentions',
			'subnav_slug'     => 'mentions'
		)
	);

}
add_action( 'bp_init', 'bp_activity_component_new_default_subnav', 2000 );

When you go to the Activity user's primary nav, you will reach the mentions subnav. But then the just-me subnav can't be reached anymore (even if you add it manually to the URL).

I've explored the bp_core_new_nav_default() function and I have started to build a patch. It needs to be completed for components != Activity.

Maybe it's a bit late to include it for 8.0.0. But I'd like we talk about this ticket at least before eventually punting it.

Attachments (2)

8471.patch (5.3 KB) - added by imath 3 years ago.
8471.2.patch (7.6 KB) - added by imath 3 years ago.

Download all attachments as: .zip

Change History (9)

@imath
3 years ago

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


3 years ago

#2 @imath
3 years ago

  • Keywords needs-patch needs-testing added
  • Milestone changed from 8.0.0 to Up Next

We need more testing about this change.

#3 @imath
3 years ago

  • Milestone changed from Up Next to 9.0.0

#4 @imath
3 years ago

  • Milestone changed from 9.0.0 to Up Next

Let's do it in 10.0.0 instead

#5 @imath
3 years ago

  • Milestone changed from Up Next to 10.0.0

Let's try to progress on it during 10.0.0 dev cycle.

@imath
3 years ago

#6 @imath
3 years ago

  • Keywords has-patch commit added; needs-patch needs-testing removed

Thanks to our canonical URL management, the patch is less complex: we actually just need to make sure the default subnav slug is added to the corresponding wp_admin_nav item.

#7 @imath
3 years ago

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

In 13093:

Make sure bp_core_new_nav_default() updates the previous default nav

  • The previous default nav item needs to have its slug added to its link property.
  • The default subnav slug needs to be added to the URL used by the corresponding wp_admin_nav item.
  • The new default nav item needs to have its slug removed from its link property.

Fixes #8471

Note: See TracTickets for help on using tickets.