Closed (fixed)
Project:
Organic Groups
Version:
6.x-2.1
Component:
og.module
Priority:
Normal
Category:
Feature request
Assigned:
Issue tags:
Reporter:
Created:
22 Apr 2009 at 23:03 UTC
Updated:
21 Jan 2011 at 01:15 UTC
Jump to comment: Most recent file
Comments
Comment #1
sirkitree commentedComment #2
sirkitree commentedComment #3
moshe weitzman commentedI'd love to support activity. I'll take a look at any patches that arise here.
Comment #4
Jackinloadup commentedIm digging through the module at the moment working on this feature. I will post any headway I make.
Comment #5
likewhoa commentedsubscribing.
Comment #6
tdombos commentedIsn't it very easy with Views? You simply define a relationship between activity and organic groups tables.
Something like this:
Comment #7
Scott Reynolds commentedBut what if you want to display group activity on user/14/activity. something like
There is a whole access implementation to facilitate this. Lot more then building a relationship.
Read the Developers.txt and related discussion: http://groups.drupal.org/node/21033
The api has changed since then, but there is a good discussion on the motivations for the system.
Comment #8
igorik commentedsubscribe
Comment #9
izmeez commentedsubscribe
Comment #10
JerryH commentedWould this be adding a filter to a view that allows you to show content types for that og ?
I have a situation now where I'm trying to just list content types for a og, and I have "Organic groups: OG: Posts in current group = " though I can't add TRUE to the end of that.
Is this additional view what I'm talking about and need ?
Comment #11
sirkitree commented@JerryH: that sounds correct. However OG will still have to know if an activity is within a group
@Scott Reynolds: can we share here what we have for community.module as to how it handles this and then maybe someone can work on an og implementation?
Comment #12
JerryH commentedIn my case all the content types are create inside a group (as I understand how OG works).
Were this SQL-ish I'd use "SELECT content_type FROM moo WHERE type=(the types I want) AND group_id=(the group context were in)";
Though I'm learning views & groups atm so thinking there might be another way of doing it as I've just watched webchick do something like it with the 48 hour basecamp build here : http://www.doitwithdrupal.com/free-videos
The highlighted bit is from a D5 og& views build that I'm trying to replicated (it's a site rebuild into D6).
Comment #13
JerryH commentedWell so far I've found these :
http://drupal.org/node/66145
http://groups.drupal.org/node/13428
http://drupal.org/node/213448
And it looks like this would do what I want, though it's not for D6 is seems :(
http://groups.drupal.org/node/10445
Comment #14
JerryH commentedHave part hacked this in for now, storing the last group viewed in the session.
Then have added a filter "OG Post in current group"
Comment #15
dugh commentedsubscribe
Comment #16
ngstigator commentedsubscribe
Comment #17
dayre commentedsubscribe
Comment #18
lelizondo commentedsubscribe
Comment #19
Scott Reynolds commentedHere is the patch against 6-2
It exposes all hook_og() $ops to Triggers (and therefore Activity).
It then implements Activity's Access API to create an og_membership access role. Therefore, in your Activity streams you can add in any and all OG group activity using the Activity Access filter.
Comment #20
gábor hojtsyI've never written activity integration for a module before, but will soon start due to localize.drupal.org needing such functionality (see #599322: Add activity 2.x integration). This OG integration patch is of big help to our efforts. On localize.drupal.org, most of the action happens outside of areas users could track on a Drupal site. People join and leave groups, new people become admins, others import .po files or submit massive amounts of translations. Because these are "invisible" to the members of the site, the sense of progress does not form.
We are in the process of implementing, testing and rolling out activity integration on localize.drupal.org to help with this, and the basic OG activities would be among the first steps for that.
Comment #21
amitaibuThanks Scott! From going visually over code:
Why do we call it group creator and not group? also insted of actor, how about "acting user" (like Rules)?
Can you add in the comment what the eid field is.
If the realm is the member lets have the value be Organic groups member. Also, only first letter should be capital (Please change it also in the @file)
Although it will require node_lod(), I think it's more apropriate to use og_get_node_groups().
$account should be Account.
Comment #22
Scott Reynolds commentedOk here is an updated version.
Sorry about that, I forgot about this feature I wanted to add. Basically for all the OG activities, I want the group admins to have their own messages. So when someone approves a member perhaps the group admin messages has a link to the application where normal members do not. (Sorry I actually don't use OG for anything so not sure that is actually a use case). At the most basic level it can say "User X joined your group Y you can remove them here: Z" and normal users would see "User X joined group Y".
In order for this feature to work, Activity has to be updated to the latest with these commits (http://drupal.org/cvs?commit=323158, http://drupal.org/cvs?commit=323170)
The rest of your comments should be addressed in this patch.
And the change to og_get_node_groups($node) is because it should ALWAYS return an array, even if its empty.
Comment #23
joeytheman commentedI cannot get this filter to work. Can you please export a view with the Og Access Filter configured correctly?
Thanks
Comment #24
Scott Reynolds commentedI use Views3 for my contrib work (and production work actually) so the export won't work in Views2 because Views3 has a very compact export. But here is a couple of screen shots.
You turn the filter on by choosing this: http://skitch.com/supermanscott/nuki5/og
if it doesn't work, you can rebuild the access table: http://skitch.com/supermanscott/nukse/access-rebuild
Comment #25
joeytheman commentedI don't have the "Og access control" option or have "OG" option listed under realms either. The "Available Updates" page confirmed I have the latest version of the module released today. Any suggestions?
Comment #26
Scott Reynolds commentedIm betting your og.activity.inc isn't in og/includes but in og/
Comment #27
amitaibu@Scott Reynolds,
I tried to set-up acitivity (6-2.X-dev version), but it didn't work. I have added actions, but I see that
$aids = _trigger_get_hook_aids('og', $op);returns an empty array. What is missing?Also few more minor issues:
Can we change it to "organic groups", so it won't appear as Og in the activity type.
I think more readable to have
First letter should be capital.
Powered by Dreditor.
Comment #28
gábor hojtsy@joeytheman: maybe you'll need to check the box to record og activity realm data on admin/settings/activity.
Comment #29
Scott Reynolds commentedSo I haven't rerolled it with those minor changes. Don't have time this morning got a late start.
But instructions for how to test.
Assuming patch is applied and og.activity.inc is in the og/includes folder
1.) Goto admin/build/activity and create a template for Og
2.) Do the action that should fire the activity message
3.) check the activity stream (activity/all)
4.) create a node insert template at admin/build/activity
5.) Create a post in the newly created group
6.) create a comment template and add a comment to that node
7.) edit the activity/all view and add a filter Activity Access: Og's module's access control
8.) add an argument Node: nid and use the node relationship. This argument will serve as the groups nid.
9.) Enter the groups nid into the Arguments for the preview and you should see all the activities that happened in that group
The access filter works as the following.
So this allows you to create a user stream as well by the following
1.) create a new Activity View.
2.) Add the user relationship
3.) Add the user name field using that relationship
4.) add the activity message field
5.) Add Filters Activity Access: Activity module's access control. This will put the users activity into the stream.
6.) Add node module's access control. This will put all activities around Nodes that the user creates into the stream.
7.) add comment module's access control. This will put all activites around Nodes that the user Comments on into the stream.
That View will show the current user all those Activities.
Now for the cooler View :-D.
8.) Add argument Activity: Activity Actor. This argument will take the Uid and use that as the basis for all those filters. Essentially, think of it as setting the context for those filters.
So as user 1, if i were to use as this argument with value of 2, I would see
a.) all user 2's activity
b.) all activity around the nodes user 2 created (say user 3 commented on one of his nodes).
c.) all activity around nodes user 2 commented on (say user 2 commented on a node created by user 3. Then user 3 replied to that comment)
Then by adding the Activity Access: Og module's access control, you can see all activities in groups user 2 is a member of.
Its important to note that Activity DOES respect node access control through db_rewrite_sql(). So do not add the Views Filter. #694162: Remove node_access filter from default View
Please note you must use the admin/build/activity, as noted here: #635264: Add back in activity_record_form ?. Sorry for that but we needed more information then what the standard actions workflow allowed. It is on the roadmap to be fixed prior to release so that if you enter from the standard actions section things wont be borked.
I hope all that is clear, Activity is severely lacking documentation and sorry for that.
Comment #30
likewhoa commented#22 applies properly but I am not getting any activity on group "joins or user subscription changes". I have setup the views properly and here is an export of it.
The only activity being shown on that view is ALL activity minus og activity which i triggered by joining a group & removing myself from a group. The activity templates are setup properly btw.
edit: just as a side note, I am getting
when enabling the og_module's access control filter.
Comment #31
Scott Reynolds commentedthat would mean you don't have the og.activity.inc in the right spot. move it to og/includes
Comment #32
likewhoa commentedit's in the right spot and here is the content from it to verify.
Comment #33
amitaibu@Scott Reynolds,
Thanks for the docs - we'll add them to OG's documentation as this patch will be committed.
I still have problems with making it work:
1) I'm using the 6--2.x-dev version.
2) I've set up an action on Og => insert member.
3) New member added to group, but nothing is added to {activity} - see problem in #27.
Comment #34
BenK commentedSubscribing....
Comment #35
Scott Reynolds commentedinteresting i wonder what magik is on my machine that makes it work. I will dig in again soon.
Comment #36
Scott Reynolds commentedI cannot figure out why it works for me. If this doesn't work people are really going to have to give really ridiculously detailed reports because I have literally tried everything I can think of. I have done EVERY op for hook_og in a number of different scenarios and group configurations.
And because I have done every $op i think I found a bug in og.pages.inc, where it uses the $op 'admin create' instead of 'admin new'. And I adjusted that. I have also double check the trigger_assignments table and the actions table to make sure that the Activity template got saved correctly.
I then tested to make sure that when I insert a node into a group, the activity_access table gets the Og access realm. Everything worked nice.
Perhaps its OG node access getting in the way. Activity automagikly joins node_access table (LEFT JOIN) to the query to ensure that it never surfaces Activity that the $GLOBALS['user'] cannot see and maybe that is in error? Can't imagine it is, as at my work we use a custom groups solution that behaves in a very similar way. (And I have written plenty of node access modules before for custom business goals).
Here is a patch with the Dreditor changes.
edit: I also deleted my entire og/ directory and then used CVS to checkout DRUPAL--6-2 and then applied the patch. It is working just fine. I have NO idea what makes my computer so special :-D
Comment #37
Scott Reynolds commentedRemoved this requirement with the latest Activity commits from today.
http://drupal.org/cvs?commit=329756
Comment #38
rnjthkmr88 commentedHow to add an event within a group. the functionality of og_forums and og_events are different. By using og_forums we can view/create/edit forums within our groups.This is not the case with og_events. For creating an event to the group we have to change the content type of event and create an event under create content.
Is there any other way ?? any module available for creating/editing/viewing events of groups in a seperate tab(along with view, forums, edit etc. in a group)
Thank you.
Comment #39
amitaibuI think I found the problem:
_trigger_get_hook_aids() get's the $op == 'user_insert', but in the DB {trigger_assignments} has op == 'user insert' (no underscore).
Comment #40
Scott Reynolds commentedIn og.module, lines
453
657
Use 'user insert'
Where is 'user_insert' used?
Comment #41
amitaibuCommitted.
The problem was that $op changed if Rules module exists. I have fixed it and committed -- great work Scott, thank you.
I keep on needs work, as a book page is needed.
Comment #42
gábor hojtsyPerfect. Is there a release expected with this included? :) Or is this branch stable enough to use on live sites, such as groups.drupal.org and localize.drupal.org?
Comment #43
amitaibuIf there are no surprises I'm planing to create a new release on the beginning of March.
Comment #44
amitaibu@Scott,
Maybe not a bug, but more of a design thing I'd like to better understand:
The problems that I see here are:
1) Duplication of the same message.
2) When a *new* admin get into the group, they will not see the admin messages
Can't we move this logic to og_actvity_access_grants() ?
Comment #45
Scott Reynolds commentedWell that is true. The messages table is set up for a direct UID => Message. Perhaps it should be Group_identifier_of_users => message. Not sure im willing to change Activity API though at this point.
Comment #46
amitaibu> Not sure im willing to change Activity API though at this point.
Right. I think in Activity for D7 a message should be related to an entity_type/ entity_id/ conditions. So you can relate it the message to a group entity. The conditions in the case above will be a certain og_permission.
btw, do you have time to make #29 a help page -- and maybe attach there an exported view for the lazy ones ;)
Comment #47
jenlamptonI'm using the latest 6.x-2.1 branch of og.
I'd like to get an activity stream for a group that includes people joining the group and leaving the group, but - I think - the nid for the user joining the group is entered into the activity table incorrectly, so an argument for group nid doesn't catch og subscriptions.
Jen
Comment #48
AntiNSA commentedsubscribe
Comment #49
amitaibu> When a *new* admin get into the group, they will not see the admin messages
I have come up with the Message module, to solves this problem.
@jenlampton,
Please open a new issue, and try to explain what is the "incorrect" nid.
Let's keep this issue closed.
Comment #51
oxford-dev commentedI have an issue, not sure if it is a bug or just an oversight.
I have lots of different activity types working fine but I've recently created a new type of activity 'joining a group'.
In my view, as well as the activity message, i have a relationship with content profile to display the users avatar in their activity feeds, so far so good.
However, when someone now joins a room, the avatar of the room author is displayed instead of the avatar of the person who joined the room.
After looking at admin/settings/activity/maintenance, its clear that the room author is the owner of activity feeds where other people join their room instead of the feed belonging to the actor who joined the room.
In terms of user experience, I would much rather know that a couple of my friends joined particular rooms instead of knowing that hundreds or thousands of people have joined one of my friends' room.
Not entirely sure how you might solve this.
Comment #52
dalad commentedHello oxford-dev,
I had the same problem of og confusing between subjects of the activities.
I made this patch to fix the behaviour:
#819942: OG Activities on a moderated group are wrong and duplicated
Comment #53
AntiNSA commentedComment #54
amitaibu@AntiNSA,
Nothing to review here, so let's keep it closed.
Comment #55
AntiNSA commentedthe patch in #52 needs review. doesnt it?
Comment #56
oxford-dev commentedThanks dalad but i'm still not sure if your changes which achieve what i'm after.
I think the simplest solution for me is to have the activity assigned to the acting user (ie the person joining the group) as opposed to the group owner as it currently is.
[edit] by assigning to the actor what I mean is the uid in the activity table should be the actors uid not the node authors id.
Comment #57
yosisays commentedHas this functionality been added(per #7)? I wish to show very similar activity updates in my activity feed (I'm using the latest version of OG and Activity2). What I've been seeing is that when I set the activity publisher template for og's to output a message as something like "[user] joined the group [ogname]" everything works except for [ogname] token which does not show the name of the group a user has joined. I saw you posted a patch in #32 that from what i can tell has been committed but I'm still having trouble. am i missing something?
Comment #58
happysnowmantech commentedI had a use case like #7. I tried the Activity module, but it didn't do what I needed. I'm now using the Message module and it does handle my use case.