| Project: | Organic groups |
| Version: | 6.x-2.0 |
| Component: | Og Views |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (duplicate) |
Issue Summary
I have used the instructions posted by tevih to create a view which shows all the groups a particular user is a member of. Note that this is not the same as the og_my_groups view, as it is in the context of the user profile page you are looking at, rather than the current user.
I have copied these instructions below:
- create new view of type "User"
- Click the plus image under "Arguments" to add a new argument of "UID"
- (You will get errors popping up at this point, but just disregard them)
- Create a relationship: Organic Groups: Group node (Member)
- Add a field - I added "node: title" and "organic groups: organic group description"
- I created a new display of page (I know, OP was asking about block. I was interested in page view.)
- Path: "user/%/mygroups" to pass the argument to the page
- Menu: "Tab: My Groups"
The view constructed by tevih works fine, however, when I add the field "members count" I get the following error message:
user warning: Unknown column 'og.nid' in 'where clause' query: SELECT users.uid AS uid, node_og_uid.title AS node_og_uid_title, node_og_uid.nid AS node_og_uid_nid, node_og_uid__og.og_description AS node_og_uid__og_og_description, (SELECT COUNT(*) FROM og_uid ou INNER JOIN users u ON ou.uid = u.uid WHERE ou.nid = og.nid AND u.status > 0 AND ou.is_active >= 1 AND ou.is_admin >= 0 ) AS member_count FROM users users LEFT JOIN og_uid og_uid ON users.uid = og_uid.uid LEFT JOIN node node_og_uid ON og_uid.nid = node_og_uid.nid LEFT JOIN og node_og_uid__og ON node_og_uid.nid = node_og_uid__og.nid WHERE users.uid = 1 LIMIT 0, 10 in .../sites/all/modules/views/includes/view.inc on line 765.
This looks to me like a bug in OG. However, if someone can point me to where I am going wrong, I would be very grateful.
Thanks
Comments
#1
Any thoughts?
#2
Here's my view export if that helps.
#3
I managed to create a view for displaying all groups of a particular user. My solution is a bit different from tevih's and you can find the solution at http://drupal.org/node/455890#comment-2824884. I've also attached an export of my view there. I didn't add a member count to my view, but you might try adding that...
Let me know if (and how) it works!!
#4
Update - I added the member count field and it works fine!! I've attached an export of the view containing the member count field..
#5
#1220458: Member Count field doesn't use relationship