User page reads reads -- 's Stream -- rather than displaying the user's name.

Comments

Craig Gardner’s picture

Status: Active » Postponed (maintainer needs more info)

I don't see the string "'s String" string anywhere in the code.

akalsey’s picture

Assigned: Unassigned » akalsey
Category: task » bug
Status: Postponed (maintainer needs more info) » Active
akalsey’s picture

Status: Active » Postponed (maintainer needs more info)

That string doesn't exist in the code because the words "Activity Stream" are in a variable set from the admin page. See the function "activitystream_page" in activitystream.module.

This bug existed in an early version of the module, but as far as I can tell it no longer occurs. Can you update to the latest beta and tell me if you still have the problem?

akalsey’s picture

Title: User stream page » Missing username in user's stream page title
skullJ’s picture

I have the same problem and im using the latest version.

It seems that here is the problem

	if ($uid) {
		$user = user_load(array('uid' => $uid));
		drupal_set_title(check_plain($user->name .'\'s ' . $title));
		$items = _activitystream_get_activity($user);
		drupal_set_breadcrumb(array(l(t('Home'), NULL), l(t('Activity Stream'), 'stream')));
	}

$user->name is probably empty!!!

akalsey’s picture

$user->name is probably empty!!!

Can't be. That's your login name.

Got a URL where I can look at this?

skullJ’s picture

Thank you very much!!

http://www.myfeed.gr/stream/skull

skullJ’s picture

OK i fixed the displayed username but is looks like the fuction _activitystream_get_activity dont return only user's feeds.

	if ($uid) {
		$user = user_load(array('uid' => $uid));
		drupal_set_title(check_plain($uid .'\'s ' . $title)); //change the $user->uid with $uid
		$items = _activitystream_get_activity($user);
		drupal_set_breadcrumb(array(l(t('Home'), NULL), l(t('Activity Stream'), 'stream')));
	} 

http://www.myfeed.gr/stream/skull

skullJ’s picture

lol

if drupal_set_title(check_plain($uid .'\'s ' . $title)); then shows the username

if drupal_set_title(check_plain($user->uid .'\'s ' . $title)); then shows always 0

if drupal_set_title(check_plain($uid .'\'s ' . $title)); then shows always nothing

i think the user_load have syntax error http://api.drupal.org/api/function/user_load/6 because the $uid is not a numeric!

akalsey’s picture

Where's the url "/stream/skull" coming from? Do you have a pathauto thing set up for that? The URL should be /stream/10 (or whatever the numeric uid for the user "skull" is)

skullJ’s picture

pathauto has only one option for User "path settings",the "User path settings".
I want to use [user-raw] (it means the username) so the right code for who wana use [user-raw] is that:

function activitystream_page($name = NULL) {
	drupal_add_css(drupal_get_path('module', 'activitystream') .'/activitystream.css');
	$title = variable_get('activitystream_title', 'Activity Stream');
	if ($name) {
		$user = user_load(array('name' => $name));
		drupal_set_title(check_plain($name .'\'s ' . $title));
		$items = _activitystream_get_activity($user);
		drupal_set_breadcrumb(array(l(t('Home'), NULL), l(t('Activity Stream'), 'stream')));
	} 
	else {
		drupal_set_title(check_plain('All user\'s ' . $title . 's'));
		$items = _activitystream_get_activity();		
	}
	$output = theme('activitystream',$items);
	
	//$output = theme('item_list',$items);
	if ($page) {
    // Breadcrumb navigation
    $breadcrumb[] = array('path' => 'stream', 'title' => t($title));
    $breadcrumb[] = array('path' => 'node/'. $node->nid);
    menu_set_location($breadcrumb);
	}
  $pager = theme('pager', NULL, 15, 0);
  if (!empty($pager)) {
    $output .= $pager;
  }
  
	return $output;
}

working 100%.
Thank you :D

akalsey’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

It seems like your issue is related to your customizations, then. On several test and production systems using the stock module, this issue doesn't exist.