Titles assigned in one group carry over to all other groups. A user who is a 'Member' in one group but 'Committee Chair' in another (for instance) will be listed as whichever was created first.
To make things worse, if their title is set in the second group - they will have 2 entries in that group. Clearly, multiple values are able to be stored for each user, but views is unable to filter this and lists the user for each title.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | og_titles-views.patch | 1.3 KB | mradcliffe |
Comments
Comment #1
mradcliffeHmm, it seems that the
"Organic groups: Group node (member)" relationship breaks things. I'm going to have to re-investigate the best way to do views support.
Thank you.
Comment #2
mradcliffeIt looks like the best way to do this is not to use the og_uid table at all, but to duplicate functionality of it instead. :|
Still working on things.
Comment #3
justin.hopkins commentedThanks for looking at it. Sounds like it's in good hands!
Comment #4
dtarc commentedHow's this coming? I'm happy to help test and possibly muck around with the code. I want to get this working and there's a very similar issue in OG User Roles involving similar functionality, with the group context not being taken into account with the filter handler.
#406762: Using Views to show users with a particular OGUR role in a group
Comment #5
justin.hopkins commentedI'd be happy to contribute my time and effort on this one too - but I'm really more of a novice and have been confounded looking at the module trying to understand why this isn't working.
One of my personal and professional goals is to better understand how to contribute modules, so if you can suggest any reading that might help me grok this - I'd certainly love to dive in!
Comment #6
mradcliffeI keep running into an issue trying to join directly with the og_uid table. Whenever I do that none of my views fields or filters show up! If I duplicate functionality of og's og_uid views, then I have to include a bunch of duplicate views data, which may make things more confusing.
Basically, I wish I could do this:
Instead of
This og issue is interesting though #388936: OG Views: user's groups field.
Comment #7
justin.hopkins commentedYeah so I saw #408372: Joining tables to og_uid in custom module and it looks like moshe doesn't have anything to offer. That's too bad.
Do you have the functionality working with the 'non-ideal' solution?
Comment #8
mradcliffeI have a patch that changes how og_titles views works. You shouldn't try adding fields or filters via og_uids default views though. Maybe try using og development/head which has a patch that adds an alternate way of filtering og members. I really do wish that I could integrate this so that you could just override og faces or og list views.
Also, the default view won't work, you need to create your own.
Comment #9
justin.hopkins commentedThanks for the patch, but I have to be honest and say I really don't understand what you mean when you say: "You shouldn't try adding fields or filters via og_uids default views though." What is another way to create a per group view on each groups page?
Comment #10
mradcliffeI have a better workaround now, but it probably still needs additional work/testing.
I implement the join with og_uid as a relationship. If you use the "Group Title: Membership" relationship you should be able to pull in the og_uid fields, sorts, and filters without any duplication. To get the nodes you need to use "Group Title: Group Id" or whatever it is called.
Just recently committed to CVS (http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/og_titles/o...).
Probably best to wipe out the directory and import from cvs if you don't want to wait for the snapshot release to update tonight.
Comment #11
justin.hopkins commentedAwesome thanks so much Matthew!
After looking at the new view you included in the cvs version I was able to replicate it with my existing views just by adding the two new relationships.
You rock dude! I wish I had had a chance to meet you in person at Drupalcon D.C.
Comment #12
mradcliffeComment #14
bls20 commentedJust wanted to Also Say thanks for working this out!! Helped to resolve my Dupe problem by changing the relationship.
so um yeah.... THANK-YOU!
Comment #15
DanilaD commentedHello.
Could you please post an example of a working view (exported) that shows different titles in different groups if a user does have different titles? I've checked different various of relationships, and finally I was able to get where I need by using CustomField module with this PHP field:
But I know it's not efficient, as an SQL query is generated once per each member in a group :(
I use 6.x-1.x-dev, downloaded on July 28th, 2010.
Regards,
Danila