Closed (fixed)
Project:
OG User Roles
Version:
5.x-3.2
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
15 Oct 2008 at 19:37 UTC
Updated:
14 Jul 2012 at 23:19 UTC
hook_views_tables() was wrong. Needed to add extra parameter as in:
/**
* Implementation of hook_views_tables():
* Present fields and filters for user data.
* Requires that usernode be installed.
*/
function og_user_roles_views_tables() {
$group_node = og_get_group_context();
$gid = $group_node->nid;
$tables['og_users_roles'] = array(
'name' => 'og_users_roles',
'provider' => 'internal', // won't show up in external list.
'join' => array(
'left' => array(
'table' => 'node',
'field' => 'uid'
),
'right' => array(
'field' => 'uid'
),
'extra' => array(
'gid' => $gid
),
),
'filters' => array(
'rid' => array(
'name' => t('OG User Roles: Role (group)'),
'operator' => 'views_handler_operator_andor',
'list' => 'og_user_roles_filter_role',
'value-type' => 'array',
'help' => t('Include the node only if the node author is a member of the selected OG group role - uses og_users_roles.'),
),
'gid' => array(
'name' => t('OG User Roles: Posts in current group'),
'help' => t('Posts in current group.'),
'operator' => 'views_handler_operator_eqneq',
'list' => 'views_handler_filter_groupcurrent',
'list-type' => 'select',
'handler' => 'og_user_roles_handler_filter',
),
),
);
Also added og_user_roles_filter_role() which will only list roles that are allowed in OGUR settings.
Also added og_user_roles_handler_filter() which will match og_users_roles.gid to current group gid.
Will be released in 3.3.
Comments
Comment #1
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.