What seems to be the goal of many, I'm trying to get Heartbeat to properly work with organic groups. To be obvious, I need an activity stream for each individual group.

Here's where we're at.

The "Organic Group" Block:
- While viewing a regular page, shows all heartbeats, even ones that aren't related to groups
- While viewing a group node, shows nothing at all

Created a View with Relationship "Heartbeat > OG"
- Shows some group related things. Leaves out a lot.

The "Organic Groups" Block:
- While viewing a regular page, shows all group-related beats
- While viewing ANY group page, shows all group-related beats

-------

I'm all out of options here. Maybe I'm missing something obvious because this seems like the type of error that's pretty critical.

?

Comments

Stalski’s picture

Have you tested with the dev version? The demosite works with that and it seems to work just fine there.
I will certainly make a new release.
At the demosite (logged in as swentel for instance) you will see : http://heartbeat.menhireffect.be/page/groups
=> this is a stream with groups activity (all groups) only. GroupsActivity is the object that does this trick.
At the url http://heartbeat.menhireffect.be/group/drupal-group , you will find all activity for this group specific.

What concerns views approach: the implementation for these objects (filters) are not ready yet. You can though still join the node and og_ancestry yourself by using a views relationship. On the demosite there is a stream that does this as well (only in dev release possible for the moment).

Let me know if you can get it to work.

mstef’s picture

No I'm not using the dev.

No the demo site does not work. I made a few comments. It very obviously does not work (per group). There's a lot of nodes, comments, my new comments, and no activity.

Aside from that, please elaborate on how I can get it integrated with views. I would like to have that as an option next to the block.

Thanks for your help.

mstef’s picture

Extra Credit: Way to show beats from all of the groups I'm a member of?

Extra Extra Credit: Way to blend beats from my friends and groups together?

Just brainstorming good ideas...

Stalski’s picture

Demo site and development snapshot is up to date now. I hope it works for you. I am waiting on such input like yours to release again to 6x.4.7

Stalski’s picture

Status: Active » Fixed

Ok after checking again what you said here, same conclusion:

GroupsActivity
This will give Activity for all groups together what so ever. not my groups or any restriction It is only a default. You can easily create your own stream that works for "your groups" all together.
url : http://heartbeat.menhireffect.be/page/groups

OgHeartbeat
This will give the activity where the nid (or nid target) is the group. The group id itself is available only on the group page itself AND the group post pages.
url group page: http://heartbeat.menhireffect.be/group/drupal-group
url group post page: http://heartbeat.menhireffect.be/group/event/speech-display-suite-drupal...

This last thing is now committed to drupal. It will be available in next dev snapshot. (the demosite will be updated later :) )

mstef’s picture

Status: Fixed » Active

Alright - I throw the dev in there and report back once done testing.

Thanks

mstef’s picture

Tested the DEV. No difference at all.

'Organic Group Activity'
- Shows all OG on regular page. Shows nothing on group page.

'Organic Groups Activity'
- Shows all OG on all pages.

Stalski’s picture

Status: Active » Needs review

I really dont understand why it's working for me, and not for you then.

'Organic Groups Activity'
- Shows all OG on all pages.

This is correct how i meant it. If you need something else - like your groups only - then you can just add a stream in custom module.

For the group specific activity, this works on the demo site as you can see (login with zuuperman for instance and test with drupal group and the post in that group). It only shows activity from that group only.

- Maybe try running update.php as well.
- Maybe a configuration error on the stream settings page, just guessing

mstef’s picture

Should I be using the DEV or the regular release?

mstef’s picture

Doens't matter. Each aren't working at all.

I don't see a point in repeating what's happening. I just tested with at fresh installation and the same issues are still very much present. To make another mention, trying to use Views to filter out beats only for the current group does not work either.

I don't see how this is working properly on your site.

So, I'm guessing you have no solution?

mstef’s picture

Why aren't you using og_get_group_context() in ogheartbeat.inc to determine the current group?

mstef’s picture

SQL for the group-specific block:

SELECT hm.hid AS 'hid', hm.message AS 'message_orig', hm.message_concat AS 'message_concat_orig', hm.attachments AS 'attachments', hm.concat_args, hm.custom AS 'custom', hm.description as 'description', hm.perms, hm.variables AS 'variables_orig', ua.*, 1 AS 'count' FROM {heartbeat_activity} ua LEFT JOIN {heartbeat_messages} hm ON ua.message_id = hm.message_id WHERE ua.language = '%s' AND (ua.timestamp < %d AND ua.timestamp > %d ) AND ua.nid <> 0 AND (ua.nid = %d OR ua.nid_target = %d) ORDER BY timestamp DESC

What's up with the timestamp stuff?

mstef’s picture

I think I found the problem. For all group related activities, you have to set the node target to the group ID inside Rules UI?

Stalski’s picture

Why aren't you using og_get_group_context() in ogheartbeat.inc to determine the current group?

thought about that but the code does actually the same .. will check this again.

I don't see how this is working properly on your site.

What do you mean? You see it on the demosite or you don't? We are looking at the same thing i hope. How I see it, it works just fine for me.

What's up with the timestamp stuff?

The timestamp stuff is needed to load messages before and after a given timestamp. Several things in the module depend on it. The paging is done by timestamp, i wanted to give users the possibility to handle the global timespan for messages to load in and a little of performance reasons. The cron for instance can delete messages. If it's not enabled for some reasons, heartbeat will never check for "too old messages"

I think I found the problem. For all group related activities, you have to set the node target to the group ID inside Rules UI?

Indeed. But in fact it depends a little. I give a couple of examples:
- !user joins !group ==> Here the !group is the node and so we have nid as the group
- !user posts !article in !group ==> Here the !group refers to nid_target while !article refers to nid
- !user is fan of !group ==> Here the !group refers to nid
- !user is fan of !grouppost ==> Here the !group refers to nid_target

mstef’s picture

I can't get joining a group to work...

User: [account:id]
User Target: [account:id]
Node Context: [group:id]
Node Target: [group:id]

Tried with all of them set, without targets, etc...won't get registered as a group action...

Well thanks for helping and having patience. You might want to get some real DOC together so people don't have to dig in and learn it all by trial and error.

Stalski’s picture

Joining a group, i do it like this:
User: [account:id]
User Target: 0 // since there is no second user involved directly
Node Context: [group:id]
Node Target: 0 // since there is no second node at all in this case.

These parameters are there to load sql queries against but also to check duplicates and to group messages with. So try these settings as they work for me.

mstef’s picture

Thanks

Stalski’s picture

let me know if it can be closed ;)

When i have issues like this, i try to make a short guideline at the demosite to let others know more easily. For me this is mostly an indication that it is not as self-explicatory as i thought it would be, so documentation is needed.

mstef’s picture

Well you still did an amazing job with the module. Integrating with Rules was a brilliant idea - although I hated it at first (just because it was confusing).

I did what you said with group joining/unjoining actions and it's not showing up in the group feed.

[account:id]
0
[group:nid]
0

Same thing for promoting a member to group admin. Am I missing something?

(after this, I'll close)

Thanks

mstef’s picture

Also, can't get editing a group node to show up in the group activity...

I even made a separate rule for it which checks if the updated node is a group...i made the general node update rule make sure it isn't a group.

?

Stalski’s picture

I need more information ... I cannot see why it's not working for you. Are you a developer or do you know how to debug?
if zo, it's very easy to debug in fact, just follow the stream builder logic. for the rest , i cant do much about it if i have so little information.

Stalski’s picture

First of all, if something is wrong, people check the database to see if it's logged what so ever. If so, heartbeat removes the message at display time and thus a permission or other restriction. Your configuration handles it.

I hope you have read documentation and you know about the permissions "access user profiles" and "access content"

mstef’s picture

Yes, I am a developer. Being that I followed your instructions while setting it up, and it didn't work, I didn't think to debug and check the DB. Yes, I know about permissions, and that isn't the issue, especially because I'm doing most of the testing as UID #1.

I'll poke around and see what I can find.

mstef’s picture

Status: Needs review » Closed (fixed)

Looks like BOTH the node context and target have to be set to the group ID.

Stalski’s picture

Status: Closed (fixed) » Needs review

hmm can you point out the line of code?
Can you come on IRC in #drupal or #drupal-support (freenode IRC channels)? Maybe it's best i try to help you instantly when i am available.

mstef’s picture

Status: Needs review » Closed (fixed)

Well, there's still one problem:

og_activity: User becomes co-owner of a group, doesn't get triggered when it happens.

mstef’s picture

Status: Closed (fixed) » Active
Stalski’s picture

Status: Active » Needs review

indeed. and the code for it is not there anymore :(

mstef’s picture

Why not? Can we make it happen?

Stalski’s picture

yes in fact it should work.

Stalski’s picture

For the matter of become co-administrator: It's going to be fixed in next commit. I did not return the heartbeat message itself. For me it was still stored.

Stalski’s picture

I get now:

Stalski is now a coadministrator of Drupal group.
mstef’s picture

yes in fact it should work.

For the matter of become co-administrator: It's going to be fixed in next commit.

Which one is it? It doesn't do anything on my end right now (using latest stable release).

Stalski’s picture

with dev release ofcourse (for stable release you have to wait a little more) ... the co administer rule works. It will be available from next dev snapshot (tomorrow) or directly from cvs now.

mstef’s picture

Status: Needs review » Active

I'll wait. Thanks again.

Stalski’s picture

So with the seven release , is it fixed.
Every issue you mentioned is fixed as far as i can see and my testing go. Let me know your input.

Stalski’s picture

Status: Active » Postponed (maintainer needs more info)
mstef’s picture

Works!

Strange note: [node:ogname-title-link] doesn't work. Will use [node:title-link] instead.

Stalski’s picture

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

hmm ok :) strange, will check that as well.

Stalski’s picture

Status: Needs work » Fixed

It works for me. [node:title-link] is not the same ofcourse. node title is the group post title, where ogname-title-link is the group it belongs too and can only be used when the nid target for instance is a group. !user posted !title in !ogtitle ...

mstef’s picture

Well I was only using [node:title-link] for the 'user becomes co-admin of a group' rule, so the node in question will always be the group.

Surprised it worked for you - my heartbeat contained the actual token text.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.