Skip to:
Content

BuddyPress.org

Opened 10 years ago

Closed 10 years ago

#903 closed defect (bug) (fixed)

user anv gets wrong path for visitors in trunk

Reported by: mariusooms Owned by:
Milestone: 1.1 Priority: major
Severity: Version:
Component: Keywords: navigation
Cc:

Description

For visitors the relative path is wrong when navigating the user nav items, like wire, friends, blogs, groups.

The fix I found is to change line 83 of bp-core-templatetags.php (trunk):

$link = $user_nav_itemlink?;

to:

$link = $bp->displayed_user->domain . $user_nav_itemlink?;

Change History (6)

#1 @mariusooms
10 years ago

Sorry for the code mess up, line 83 bp-core-templatetags.php:

$link = $user_nav_item['link'];

change to:

$link = $bp->displayed_user->domain . $user_nav_item['link'];

#2 @johnjamesjacoby
10 years ago

Unless I'm wrong, I'm not sure how that fix works... The code around line 83 is...

		if ( $bp->loggedin_user->domain )
			$link = str_replace( $bp->loggedin_user->domain, $bp->displayed_user->domain, $user_nav_item['link'] );
		else
			$link = $user_nav_item['link'];

So your fix is including an empty loggedin_user->domain... Unless we're on different branches of the trunk somehow?

#3 @mariusooms
10 years ago

No....not an empty loggedin_user->domain...I'm including the displayed_user->domain so that the path gets set correctly when the user is not a loggedin_user->domain as per the condition. So the complete conditional would be:

if ( $bp->loggedin_user->domain )
  $link = str_replace( $bp->loggedin_user->domain, $bp->displayed_user->domain, $user_nav_item['link'] );
else
$link = $bp->displayed_user->domain . $user_nav_item['link'];

So you see...the user_nav_itemlink? by itself if the viewing user is not logged in does not suffice for the complete path. The displayed_user->domain makes sure the path is consistent for all paths and tags on the user_nav_item.

#4 @johnjamesjacoby
10 years ago

I totally missed that. Twice. Haha! Good catch.

I'll try this in my test environment now and report back.

#5 @apeatling
10 years ago

  • Milestone changed from 1.0.4 to 1.1

Milestone 1.0.4 deleted

#6 @apeatling
10 years ago

  • Resolution set to fixed
  • Status changed from new to closed

FIxed in trunk, thanks.

Note: See TracTickets for help on using tickets.