Errors on /stream

notice: Trying to get property of non-object in /sites/all/modules/activitystream/activitystream.module on line 244.
notice: Undefined variable: page in /sites/all/modules/activitystream/activitystream.module on line 183.

The first one is caused by this code on line 244

} elseif ($user->uid) {

Since in this case we are calling the function _activitystream_get_activity with no arguments, and $user defaults to NULL. Changing the check to just $user works fine, and shouldn't cause any problems as the $user object is null if no $user is passed to the function.

The problem with $page is because the $page variable is never set during this function call, nor passed to it. Given that this function is only ever called as a menu callback I think it's safe to assume that $page would always be true, and just remove the if statement all together.

Fixing the problem with $page on line 183 introduces these errors

notice: Undefined variable: node in /sites/all/modules/activitystream/activitystream.module on line 186.
notice: Trying to get property of non-object in /sites/all/modules/activitystream/activitystream.module on line 186.

So I removed this line

$breadcrumb[] = l($node->nid, 'node/');

which doesn't seem to be of any use since the $node object is never loaded for this page request, and I can't figure out how or why we need it in the breadcrumb.

Comments

akalsey’s picture

Status: Needs review » Reviewed & tested by the community

Looks like the $page and breadcrumb issues both come from a refactoring where I split the viewing code into multiple functions. Ported to 5.x and committed. Will apply patch to 6.x branch shortly

akalsey’s picture

Assigned: Unassigned » akalsey

Ported to 5.x and committed.

akalsey’s picture

Status: Reviewed & tested by the community » Fixed

Applied to 6.x and committed.

akalsey’s picture

Status: Fixed » Closed (fixed)