I just created a Stream and Message (just playing around) and then I started getting white screen errors...

Fatal error: Call to a member function hasAccess() on a non-object in /var/www/html/testsite/sites/all/modules/contrib/heartbeat/heartbeat.module on line 1239

Looks like $variables['stream'] is FALSE due to access control.

Comments

nicholasThompson’s picture

Status: Active » Needs review

Possible quick fix? Change line 1239 from:

if (!$heartbeatStream->hasAccess()) {

to

if (!$heartbeatStream || !$heartbeatStream->hasAccess()) {
Stalski’s picture

Status: Needs review » Needs work

Yesterday I performed a big commit (refactored the plugins completely). I am not sure if this problem will be gone or not.
Setting this to needs work so it will be taken up quickly

Stalski’s picture

Status: Needs work » Postponed (maintainer needs more info)

Hello. Can you explain how I can reproduce this? I tried lots of things but did not get there.
The problem is that I don't see how that theme function could be called if the stream was null. Any tips would be great.
I guess the solution could work although I think I made a bigger mistake then ;)

- Edit - For now, the solution is committed. Can't harm anything.

Stalski’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

I'll set this to fixed, but if you have the info to reproduce, it would help me and others ofcourse.

xuxizh’s picture

I am struggling on the same erros.
In my case, I called a method heartbeat_messages_page($stream_name) and then will cause an error like this.
The reason is the I didn't set the permisson allow the memeber to view this stream.

I think in you cases, should also some permission erros.

Stalski’s picture

Function heartbeat_messages_page is a internal menu callback with a menu access callback. It also needs the correct parameters like any other PHP function.
I don't say not to use it, but it shouldn't be needed