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.
| Comment | File | Size | Author |
|---|---|---|---|
| actvitystream-php_notices_on_stream_page.patch | 1.69 KB | eojthebrave |
Comments
Comment #1
akalsey commentedLooks 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
Comment #2
akalsey commentedPorted to 5.x and committed.
Comment #3
akalsey commentedApplied to 6.x and committed.
Comment #4
akalsey commented