Closed (fixed)
Project:
Organic Groups
Version:
7.x-2.x-dev
Component:
Og Views
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
31 Mar 2012 at 08:14 UTC
Updated:
4 Jan 2014 at 01:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
nedjoAre you using the 7.x-1.x dev branch? You'll need it for the roles views exposure implemented in #1164516: OG Roles in Views: Patch Attached.
Comment #2
creando sensaciones commentedI'm using OG 7.x-2.0 alpha 2. Is there a way to filter by role? I need to make views showing all members of a certain Group role.
Thanks
Comment #3
pomliane commentedIt seems OG roles in Views have not been fully implemented in og-7.x-2.x yet—or I'm missing something.
As they appear to be implemented in 7.x-1.x, isn't it a regression/bug?
At least like a major feature, doesn't it?
Comment #4
Sylense commentedsubscribe
Comment #5
creando sensaciones commentedAs I didn't found a solution I made myself a little function to extract them directly from the database:
Returns an array with uid, name and picture-uri of all group members with a certain role.
needs Group id and Role id
Comment #6
SebCorbin commentedTagging
Comment #7
Chipie commentedHow can I use this function in a view?
Comment #8
Renee S commentedComment #9
Renee S commentedComment #10
SebCorbin commentedThis patch is a test, just throwing it here for testbot
Comment #12
ifish commentedIs there still no the most basic work around for this? Thanks in advance..
Comment #13
ifish commentedIf possible then a very basic Views PHP Code filter would be awesome for a fast fix. It's possible to show the current user "roles" in the fields section, so I'm wondering if it's possible to use this in the Filter criteria, such as if user has this role, then show.
Comment #14
kaw3939 commentedConfirmed - Same problem
Comment #15
SebCorbin commentedWalkthrough:
Comments highly welcome
Comment #16
ifish commentedI'm not sure if I've done something wrong but I'm getting broken handler error
Comment #17
SebCorbin commentedYOu need to flush your caches for the handler to be discovered in og.info
Comment #18
ifish commentedWorks great, thanks alot for this! However, it seems like it has removed the "user role field" that was used by OG before, it's now displaying it as an broken handler. Unless I'm doing something wrong.
Comment #19
SebCorbin commentedI still have the field "(OG membership from user) OG membership: OG user roles in group" on my end, I left the code providing that field as it was, though the new relationship could be harnessed
Comment #20
ifish commentedAh for some reason "class og_handler_field_user_roles extends og_handler_field_prerender_list { " etc was removed.
Also on a side note, I'm not quite sure if it's actually the user role's handler problem but if selecting Operator "Is none of" it doesn't seem to do anything.
Comment #21
amitaibuThanks for working on this.
Leftovers?
user table?
relationship. Also missing dot.
Can you explain?
Comment #22
SebCorbin commentedThe FIXME was in fact irrelevant as we cannot have memberships other than related to user entity (I guess?)
As for the "Is none of", I tried it and it works, so if you can provide me you views structure and possibly a query, that'd help me a lot.
New patch attached as per #21 (simplified the class).
Comment #23
amitaibu> The FIXME was in fact irrelevant as we cannot have memberships other than related to user entity (I guess?)
No, the og-membership can be related to any entity. It treats users and nodes the same way.
Comment #24
SebCorbin commentedWell, considering the relationship with user already adds a condition on entity_type, this should not be a problem
Comment #25
amitaibu@SebCorbin,
I'm unable to see this filter -- can you attach an exported View so I can see it working?
Comment #26
SebCorbin commented@Amitabiu the second exported in this file (http://drupalcode.org/project/l10n_server.git/blob/73fc0cdeffec993c30b51...) makes use of OG Roles filter
Comment #27
bkildow commentedOn my initial test, #22 appears to work for me. I was able to create a new group role, assign some people to it in a group, then display only those people assigned to this role following the walkthrough in #15. Thank you for your efforts!
@Amitaibu, I didn't see this filter at first either. It appears under a different filter grouping: "OG user roles". I was looking under "OG membership" in the filter criteria screen, and I didn't see it. Searching for "role" in this screen also showed it.
Comment #28
amitaibu@SebCorbin, @bkildow
Sorry I'm unable to see it working. Can you please create a simple View based on OG-example content types, and write the steps to reproduce?
Comment #29
SebCorbin commentedPreviewed with the node id of the group previously created as parameter: only shows user "test group admin"
Comment #30
amitaibuCommitted, thanks!
Comment #31
tjhart87 commentedWhere was this committed? I'm not seeing this in 7.x-2.0-rc4. Was it only added to dev?
Comment #32
SebCorbin commentedYes, it's in dev (btw, thanks Amitai :) )
Comment #33
tjhart87 commentedApplied patch to rc4 and all is well. Great work guys!