Opened 12 years ago
Closed 11 years ago
#4630 closed defect (bug) (fixed)
Problem with bp_get_name_from_root_slug()
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 1.7 | Priority: | normal |
Severity: | major | Version: | 1.6.1 |
Component: | Route Parser | 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; } }
Moving to 1.7 for investigation