[buddypress-trac] [BuddyPress] #2169: Function bp_current_component() returns wrong value at base member profile URL

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Thu Mar 11 03:51:18 UTC 2010


#2169: Function bp_current_component() returns wrong value at base member profile
URL
-----------------------------------+----------------------------------------
Reporter:  foxly                   |       Owner:       
    Type:  defect                  |      Status:  new  
Priority:  major                   |   Milestone:  1.2.3
Keywords:  bp_current_component()  |  
-----------------------------------+----------------------------------------
 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.

-- 
Ticket URL: <http://trac.buddypress.org/ticket/2169>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list