Opened 7 months ago

Last modified 5 weeks ago

#4630 new defect (bug)

Problem with bp_get_name_from_root_slug()

Reported by: DanielJuhl Owned by:
Priority: normal Milestone: 1.8
Component: Core Version: 1.6.1
Severity: major Keywords:
Cc:

Description

I'm not sure about this, but as far as I can see there is a problem with this function in BuddyPress v1.6.1.

Right now the page title for the activity directory is simply: " Directory" instead of "Activity Directory".

Line 717 in bp-core/bp-core-template.php

	// Loop through active components and look for a match
	foreach ( $bp->active_components as $component => $id ) {
		if ( !empty( $bp->{$component}->root_slug ) && ( $bp->{$component}->root_slug == $root_slug ) ) {
			return $bp->{$component}->name;
		}
	}

I have a couple of danish installations, and I have created WordPress pages with danish slugs for each component directory and then linked them the settings page.

The problem is then that if I print a $bp->{$component} I see that the root_slug contains the actual root slug used on my site but $root_slug contains the default system slug.

In other words the activity directory would in the above case have: 'activity' == $root_slug
But $bp->{$component}->root_slug would containg "aktiviteter", and "activity" would be in $bp->{$component}->slug

So maybe the code should be changed to, at least that solved my problem:

	// Loop through active components and look for a match
	foreach ( $bp->active_components as $component => $id ) {
		if ( !empty( $bp->{$component}->slug ) && ( $bp->{$component}->slug == $root_slug ) ) {
			return $bp->{$component}->name;
		}
	}

Change History (3)

  • Milestone changed from Awaiting Review to 1.7

Moving to 1.7 for investigation

  • Milestone changed from 1.7 to 1.8

I'm not able to duplicate this on trunk. Punting to 1.8.

Note: See TracTickets for help on using tickets.