Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When I set my stream to show the "Older messages" link and click on it the data is appended in some sort of JS notation. See example below. This doesn't happen with 6.x-4.10.
{ "status": true, "data": "\x3cdiv class=\"heartbeat-message-block heartbeat_shout odd\"\x3e\n\n \x3cdiv class=\"beat-item \" id=\"beat-item-282\"\x3e\n\n \x3cdiv class=\"icon-left-margin\"\x3e\x3cspan class=\"avatar\"\x3e\x3ca href=\"/b2learn_3_dev/users/administrador\"\x3e\x3cimg src=\"http://daniel-madruga-de-aquinos-computer.local/b2learn_3_dev/sites/default/files/imagecache/user_picture_meta/pictures/picture-1.png\" alt=\"administrador\" title=\"administrador\" class=\"imagecache imagecache-user_picture_meta\" width=\"30\" height=\"30\" /\x3e\x3c/a\x3e\x3cspan class=\'user-pic-space\'\x3e\x3c/span\x3e\x3cimg src=\"/b2learn_3_dev/profiles/drupal_commons/modules/b2learn/b2learn/heartbeat_implementation/images/heartbeat_shout.png\" alt=\"\" title=\"\" width=\"30\" height=\"30\" /\x3e\x3c/span\x3e\x3c/div\x3e\x3cdiv
(...)
Comment | File | Size | Author |
---|---|---|---|
#11 | groupContext.patch | 804 bytes | Patrizio |
#4 | patch-older-msgs-6.x-dev.patch | 2.34 KB | dmadruga |
Comments
Comment #1
Stalski CreditAttribution: Stalski commentedI thought this was fixed too. Are you sure you are working on the dev branch? There were some bugs in version 10 that are solved already. I was planning a release soon.
This kind of bug keeps me from releasing ofcourse, since it is a major issue.
Can you test it with the dev version? You mentioned 10 but you reported the issue under -dev. So which is it ;)
Comment #2
dmadruga CreditAttribution: dmadruga commentedHey Stalsky,
thanks for you prompt reply.
I restarted from scratch, downloaded the newest version from cvs and cleared every possible cache I could remember. Things got a little better. Actually I got back to the same point I was when using ver 6.x-4.10.
But the "Older messages" link still doesn't work for the stream OgHeartbeat (that's why I changed the title of the bug). And I figured out what's going on: this stream depends on the group context. When the JS call polls for messages it uses no reference to the group. I made a test changing the
private function setGroup($nid = 0)
to
private function setGroup($nid = 1)
1 is the nid of an organic group. Everything works like a charm!
The problem reported at http://drupal.org/node/1034224 doesn't happen anymore after this change.
To make a long story short: when the stream depends on the OG context neither the "Older messages" link nor the auto-append after a shout work.
I'm too tired to work on it now, but tomorrow I'll address it ftitm.
Rgds,
Daniel Madruga.
Comment #3
dmadruga CreditAttribution: dmadruga commentedI've been working on it and came up with a patch that works for me. Find it attached.
I modified 3 files:
heartbeat.module --
This code tests is there's a context and adds a GET query to the URL with the gid.
--
heartbeat.pages.inc --
If it finds the GID in the URL it sets the group context.
--
ogheartbeat.inc --
I tested this patch with the the OgHeartbeat and Personal Heartbeat default streams and also with my customized streams. It all worked like a charm.
Stalski, could you please take a look at this patch and make some tests?
Rgds,
Daniel Madruga.
Comment #4
dmadruga CreditAttribution: dmadruga commentedOoops... I forgot to attache the patch.
Comment #5
Stalski CreditAttribution: Stalski commentedThis was fixed. That was a bug i spotted myself just a couple of hours ago.
As it is a lot less code an small change (the request group_nid was not used in ogheartbeat yet), would you test the dev version first? I don't have any problems with it anymore. So checkout latest dev of from cvs and you should be fine.
I would have done it with a patch, but as i said, i saw this bug myself.
Comment #6
Stalski CreditAttribution: Stalski commentedComment #7
jitse CreditAttribution: jitse commentedI am still experiencing the problem with the OG-context sensitive streams (ogheartbeat) on the 6.x-4.x-dev from 2011-Jul-26.
Other (by default included) streams are fine, the OG context sensitive streams "display older messages" are not working.
Comment #8
paul_visser CreditAttribution: paul_visser commentedAfter looking thru the code with Jitse (6.x-4.x-dev from 2011-Jul-26) it looks like in ogheartbeat.inc's constructor the function $this.setGroup() is not setting anything. Which explains why after pressing the "Older messages" link there is nothing displayed. In the function $this.setGroup() the nid of an organic group should be included as a parameter to display older messages.
Comment #9
jitse CreditAttribution: jitse commentedOn the latest dev (1 august 2011) I see no code facilitating group context.
If I use dmadruga's code it still fixes the problem.
I did not alter the ogheartbeat.inc, but did apply patches on heartbeat.pages.inc and heartbeat.module
Comment #10
Crom CreditAttribution: Crom commented#9 works for me. Thanks Jitse
Comment #11
Patrizio CreditAttribution: Patrizio commentedI have the same problem with 6.x-4.x-dev
Here is my patch
Comment #12
Stalski CreditAttribution: Stalski commentedPushed the last solution to git.