Hi Stalski. I said I'd create an issue for this if I could not find a solution.
I have my stream for my "Public Heartbeat" stream set to update every 1 minute.
It will not update. It will also not update if I "make a shout" using the shout block. (But if I refresh the page, the shout will have gone through correctly).
However, if I'm viewing the block on, say, my "Personal Heartbeat" profile stream page, the updates occur. Submitting the shout form will refresh the personal heartbeat stream (as well as the public heartbeat stream) via AJAX, as expected.
If I put the Personal Heartbeat block on a page with another block, it will fix polling for both of them.
Same goes for the Organic Group MembersActivity heartbeat. Doesn't work unless there's a Personal Heartbeat block on the page.
I have not tested it outside of these three stream types. But I have tracked it as far as the "hasAccess" protected function. On line 148 of "heartbeataccess.inc" in /heartbeat/includes, there is a check: if ($this->hasAccess()) { this check will not pass if the Personal Heartbeat block is not on the page.
As a sidenote, it may also be worth noting that, seemingly, if one block successfully gets access, it will update all blocks even if they do not get access.
Comments
Comment #1
Stalski commentedHmm bizar. I could not analyse it as being :
"when private block is enabled, it works" OR what i think "it only works for blocks, not for pages".
I will try this out. This is not included in simpletest as it is very hard to do such a thing, so maybe something got broken.
I will get back to you.
Comment #2
Stalski commentedAbout the access part. that could be a problem although the permissions on message level would unset the restricted ones. But as you insinated, it is certainly a problem. I'll be back on this as well. I think both issues have the same source.
Comment #3
Stalski commentedComment #4
Stalski commentedI committed a fix: http://drupal.org/cvs?commit=413732
Can you test it if it works for you too. I think i was able to reproduce it with the public and private block next to each other.
Comment #5
Offlein commentedHi Stalski,
I'm afraid that fix did not work. AJAX updating is not occurring at all now, and also seems to destroy . For the record: I am testing using the shout form. Here what I've got going on.
Originally (Before this Fix)
Scenario 1: On a group page, with a block of the MembersActivity stream and a Shout form block at the top.
Hitting the "Shout!" button gives no result. Manually refreshing the page shows the shouted message, however. Automatic polling does nothing.
Scenario 2: On your profile Personal Heartbeat page, with a shout form at the top.
Hitting shout automatically updates the page. Automatic polling works.
Scenario 3: On a group page, same as Scenario 1, but there is a Personal Heartbeat block on the page, as well.
Hitting the shout button automatically updates both the MembersActivity block and the Personal Heartbeat block. Automatic polling works.
After fix
Scenario 4: On a group page, like in Scenario 1. Clicking the shout button makes a throbber appear. The stream does not update automatically, but the shout went through if I refresh manually. Automatic polling does nothing.
Scenario 5: On the user profile Personal Heartbeat page.
Clicking the shout button causes the throbber to appear indefinitely, my server load increases significantly and eventually crashes. (This is a less-than-ideal situation..) Automatic polling of course does not work either.
Comment #6
Stalski commentedThere are two problems i see:
I checked at your site and viewing the confiuration settings for polling for newer messages, i saw this:
heartbeatPollNewerMessages": { "privateheartbeat": "60" }which means that only the private heartbeat is configured to poll for newer messages. It has to be a valid time selected there. This is setting per stream, so you should do the same thing at a group if you want that.
The shout is another matter! The shout is calling the function "Drupal.heartbeat.pollMessages()" and it goes totally wrong there. i am fixing this now
...
Fixed and committed
Comment #8
Offlein commentedHi Stalski,
I'm really sorry, but this is totally not fixed. (I didn't see your edit, or I would've caught this before System automatically closed the issue.)
I installed a completely fresh Drupal 6.19 and did these steps, which includes the discovery of what I believe to be another bug:
And that's my recent news in this saga. The OG Members Activity block still does not update dynamically if Shout block is used, even in a fresh install.
Comment #9
Stalski commentedComment #10
Stalski commentedComment #11
Stalski commentedComment #12
Stalski commentedfixed, see http://drupal.org/cvs?commit=427264
Comment #13
Offlein commentedIt worked, Stalski! You're a hero!!