Opened 15 years ago
Closed 15 years ago
#2169 closed defect (bug) (fixed)
Function bp_current_component() returns wrong value at base member profile URL - FIXED!
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 1.2.3 | Priority: | major |
Severity: | Version: | ||
Component: | Keywords: | bp_current_component() | |
Cc: |
Description
The function bp_current_component() is supposed to return the name of the page within a component on a member profile.
When a visitor is at www.example.com/members/username/friends/ bp_current_component() should return “friends”, when the user is at www.example.com/members/username/activity/ it should return “activity” and when at www.example.com/members/username/ it should return null.
However, when bp_current_component() is called at www.example.com/members/username/ it returns “activity” instead of null.
This makes it impossible to route a user to any template other than “activity” when they land at the base of a member profile, and because components like the user activity stream hard-code the user’s profile URL into their links, the problem cannot be fixed by appending /profile/ on to the generated URL inside templates.
This causes major problems for any website design that would rather not have visitors default to a user’s activity stream. For example, a portfolio, realty, or professional services site.
To replicate the problem:
On a default buddypress installation with the default theme selected, add <?php echo bp_current_component()?> at line 8, in members/single/home.php, then navigate to www.example.com/members/username/
The word “activity” will be displayed in the profile header, demonstrating the defect in the function.
IMPORTANT: There is no documentation for this function in the buddypress source code or on the buddypress website. (Forum posts are not an acceptable form of documentation as they often contain outdated or incorrect information) …please consider releasing properly documented source code.
Change History (5)
#1
@
15 years ago
- Summary changed from Function bp_current_component() returns wrong value at base member profile URL to Function bp_current_component() returns wrong value at base member profile - FIXEDURL
#2
@
15 years ago
- Summary changed from Function bp_current_component() returns wrong value at base member profile - FIXEDURL to Function bp_current_component() returns wrong value at base member profile URL - FIXED!
#3
@
15 years ago
Please consider helping out with source code and documentation, this is an open source project, if you find the fix, document it.
#4
@
15 years ago
Okay, I'll stop nagging now.. :)
I'd be happy to help out ...actually, I'd really, really like to help out ...but while I have over ten years' coding experience, I've never worked as part of an open source development team before.
-How do the developers synchronize and interact with each other? Is there a mailing list? An IRC Channel? Is it all done through trac?
-How do I contribute code, documentation, and fixes?
-Where can I get a copy of your development roadmap?
-Where can I get a list of the changes you make to each version?
Thanks!
-Foxly
#5
@
15 years ago
- Resolution set to fixed
- Status changed from new to closed
Please post the solution you found.
How do the developers synchronize and interact with each other? Is there a mailing list? An IRC Channel? Is it all done through trac?
This is all done through Trac, IRC: #buddypress-dev on Freenode and on http://bpdevel.wordpress.com/
How do I contribute code, documentation, and fixes?
You can open tickets and report bugs. If you want to contribute code then get a copy of the source via subversion: http://svn.buddypress.org/ you can then make the fixes and create diff/patch files of the changes. Once you have the changes in a file you can attach this to a ticket and tag it as "has-patch". This can then be checked and committed to the core.
Where can I get a copy of your development roadmap?
http://buddypress.org/about/roadmap - currently being finalized for 1.3 after a community vote.
Where can I get a list of the changes you make to each version?
This problem can be resolved by adding the following line of code to the wp-config.php file:
define( 'BP_DEFAULT_COMPONENT', 'profile');
Please consider properly documenting your code. You could have saved us 2 hours of debugging time by listing this *completely undocumented* either on the BP site or in the bp_current_component()function header.
-Foxly