Looking to see if integrating with Organic Groups is on the list or could make the list (possible)?

Basically when a user logs in, drupalchat would look at all the groups the user belongs to and then filter/create the Online User list based on all the members belonging to those groups.



Equinger’s picture


Equinger’s picture

new2.07 KB

Here's a patch for this integration. Please review it. I also believe there was a problem that I addressed with User Relationship integration. Great module!

psychobyte’s picture


Apfel007’s picture

is this patch working? I didn't have time to test it- yet..

sjeandroz’s picture

I tried it and it seems to works! thanks it's a usefull patch!

darklrd’s picture

Thanks a lot! I will commit it in 6.x-2.x-dev.

@all - Btw, I had a query. Why are you not using 6.x-2.x?


thirdender’s picture

new2.86 KB

I got this to work against DrupalChat 7.x-1.0-beta10 and Organic Groups 7x-1.5. I had to modify the query to work with the new Organic Groups structure. Seems to work pretty good though. Also, I created the diff against a live module folder (not against git), so please let me know if that works or if I should re-roll the patch.

Also, I pulled most of the new query code from Code Karate: Drupal 7 getting all members of an Organic Group. However, I think I missed the user->status check. That shouldn't be important right? Because only logged in users will be shown…?

edutrul’s picture

thirdender: I didn't have success to reproduce your patch on tag 7.x-1.0-beta10 and also on current branch 7.x-1.x(tag: 7.x-1.0-beta15)


darklrd’s picture

thirdender, thank you for providing this patch, will review it and try to include it in current branch.

darklrd’s picture

edutrul, please feel free to submit a patch if you are working on this, thanks! :)

candelas’s picture

Issue summary:View changes

Is this patch working in the 7.x-1.4? Thanks

SocialNicheGuru’s picture

Status:Active» Needs review
SocialNicheGuru’s picture

Version:6.x-1.x-dev» 7.x-1.4

Anything for OG 7.2?

When used with OG 7.2:

|Warning: Invalid argument supplied for foreach() in _drupalchat_buddylist() (line 936 of d7/modules/all/drupalchat/drupalchat.module).

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) AND (ogm.etid <> '1')' at line 1: SELECT DISTINCT ogm.etid AS etid#012FROM #012{og_membership} ogm#012WHERE (ogm.entity_type = :db_condition_placeholder_0) AND (ogm.gid IN ()) AND (ogm.etid <> :db_condition_placeholder_1) ; Array#012(#012 [:db_condition_placeholder_0] => user#012 [:db_condition_placeholder_1] => 1#012)#012 in _drupalchat_buddylist() (line 948 of /7/modules/all/drupalchat/drupalchat.module).

it brings the site down