Opened 14 years ago
Closed 14 years ago
#3582 closed defect (bug) (fixed)
Browser title for a component's directory only displays the word 'Directory'
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 1.5 | Priority: | normal |
Severity: | normal | Version: | 1.5 |
Component: | Core | Keywords: | has-patch dev-feedback |
Cc: |
Description
Using 5348 from trunk and default theme, most of the BuddyPress component pages have browser titles such as 'Members Directory', 'Activity Streams Directory, and 'Discussion Forms Directory'.
For Groups, however, I'm only seeing 'Directory'. Not sure if this is a theme or plugin issue though. I tested a couple themes and found the same result on each - though the other themes are based on the default for 1.5.
At any rate, it should read 'Group Directory' to follow the pattern.
Attachments (2)
Change History (14)
#1
@
14 years ago
- Summary changed from Browser title for 'Groups Directory' only displays the word 'Directory' to Browser title for 'Group Directory' only displays the word 'Directory'
#2
@
14 years ago
I've found this happens if:
- My root pages are nested (eg. 'community/members', 'community/groups')
- Or if I'm using a custom BP_X_SLUG define.
#3
@
14 years ago
- Summary changed from Browser title for 'Group Directory' only displays the word 'Directory' to Browser title for a component's directory only displays the word 'Directory'
#4
@
14 years ago
OK, digging further into this it seems to happen anytime you're using a custom slug (as r-a-y mentions).
I had the groups slug as groups-2 because an earlier page was in the trash. Deleting the old page and changing the slug to 'groups' I now get 'User Groups Directory' for the browser title.
#5
@
14 years ago
- Milestone changed from Awaiting Review to 1.5
- Severity changed from trivial to normal
Confirmed. It's not getting the component name from the root_slug in the page title filter.
#6
@
14 years ago
- Component changed from Theme to Core
- Keywords has-patch added
Problem was in bp_get_root_slug().
$component_name was using the active component's array value, which is always '1' if it is active. So I removed this variable and replaced $component_name with $component.
#7
@
14 years ago
- Keywords dev-feedback added
I was just looking at this, and about to add a patch with the same fix. I want another opinion about changing bp_get_root_slug(); its also used in bp_get_options_nav()
#8
@
14 years ago
This could potentially be a 3rd-party plugin problem.
Since $component_name circa 1.2.x used to be an alphabetical string, for backpat, we can check if $component_name isn't numeric, if so, use that value?
#9
@
14 years ago
This is another change that stems from the fact that $bp->active_components and $bp->loaded_components were jumbled at some point during the dev cycle.
As for bp_get_options_nav(), this change will have no effect. It turns out that $bp->displayed_user is *never* empty, so the "then" condition of the ternary operator is never called. This is either due to a logic error of mine at one point, or due to more recent changes in BuddyPress. At the moment, the logic error doesn't matter, because the way that component ids are indexed has also changed since that point - so, in contrast to what the comment says, you don't actually ever need the root_slug. We should open a ticket to look at this after 1.5, but for now I don't want to touch it because it's working. In any case, 3582.01.patch will have no effect on it.
r-a-y: Good call. (Except that a straight numeric check won't work, because those 1s are strings.) See 3582.02.patch.
Actually, it should be 'Groups Directory' I suppose. Must be after 5pm here... *sigh