Opened 13 years ago
Closed 13 years ago
#3512 closed defect (bug) (fixed)
Problem with 3rd-party root components & bp_modify_page_title()
Reported by: | r-a-y | Owned by: | |
---|---|---|---|
Milestone: | 1.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Core | Keywords: | has-patch needs-testing |
Cc: | brajesh@… |
Description
If we're on a 3rd-party root component and we're on a single item, bp_modify_page_title() currently looks at:
$bp->bp_options_nav[$bp->current_component][$bp->current_action]['name']
It should change to:
$bp->bp_options_nav[$bp->current_item][$bp->current_action]['name']
Encounted this when I was updating Achievements.
---
I've also changed the title order to be a bit more SEO-friendly for 3rd-party plugins.
Order is now:
component item name | component nav section name | root component name
instead of:
root component name | component item name | component nav section name
Attachments (2)
Change History (16)
#2
@
13 years ago
- Keywords needs-testing added
- Milestone changed from Awaiting Review to 1.5
- Version 1.5 deleted
Confirmed.
#3
@
13 years ago
r-a-y, this patch doesn't seem to be working for me. Here's what I did:
- created a new Achievement
- visited that Achievement's page (so bp_is_single_item() would be true)
The problem is that $bp->bp_options_nav[$bp->current_item] is, in my case, empty. I have not looked more deeply to see why this is the case.
#4
@
13 years ago
I've made a few modifications to Achievements to be compatible with BP 1.5, so that's probably the reason.
If you fix the subnav issue in Achievements for BP 1.5, you should encounter my problem. If you want, I can send you my modded version of Achievements so you can check.
#6
@
13 years ago
Should send it to Paul too, as he's the plugin author that will reap the most reward. :)
#8
@
13 years ago
Cool :)
Do we have any idea how many other plugins might give the same result as what Boone had (where there is something empty?) I'd like to avoid introducing more situations where we change up an existing API that's in use.
#9
@
13 years ago
I believe the bug only occurs if the plugin utilizes a root component and registers a subnav with bp_core_new_subnav_item().
EDIT: Also I believe the new component's root slug has to be nested so it resembles something like community/NEW_COMPONENT
The only other plugin (other than Achievements) that fits this criteria is BP Gallery by sbrajesh. I just pinged sbrajesh on Twitter. Let's see if he encounters the bug.
EDIT: BP-Media might be another plugin.
#10
@
13 years ago
- Cc brajesh@… added
Hi Ray,
Thanks you for pinging on Twitter.
just confirming this does not affect any of my plugin as none of my previous plugin uses single item(Like attachments/Jet events does). Most of my plugin either uses the directory page or the component page for user(like user/gallery etc). So It does not affect me as of now.
I have been writing a new plugin using the Component API for 1.5 specific, should be complete in a couple of days. I will certainly let you know if I find any issues :)
#13
@
13 years ago
Thanks for sending the Achievements patch, r-a-y. 3512.02.patch looks good.
Going to close this ticket. If other plugin authors see that there are problems with page titles and/or $bp->bp_options_nav (where some changes took place in this dev cycle that led to the problem reported in this ticket), please reopen the ticket or open a new one with a description. Thanks!
02.patch fixes an issue if you have your 3rd-party root component nested under a different page.
eg. 'community/achievements' and not 'achievements'
The patch passes
bp_get_root_slug()
as a parameter tobp_get_name_from_root_slug()
.Might want to add a check for
bp_get_root_slug()
inside thebp_get_name_from_root_slug()
function natively.