The User: Roles filter is apparently broken with a combination of optional + force single; if you have selected "any" it still filters by the first role option. It works correctly if you remove the force single option. This is the simplest view I could come up with that demonstrates the problem:

$view = new view;
$view->name = 'bug_demo';
$view->description = 'Demonstrates the User: Roles bug.';
$view->tag = 'test';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
'name' => array(
'label' => 'Name',
'link_to_user' => 1,
'exclude' => 0,
'id' => 'name',
'table' => 'users',
'field' => 'name',
'relationship' => 'none',
),
'rid' => array(
'label' => 'Roles',
'type' => 'separator',
'separator' => ', ',
'empty' => '',
'exclude' => 0,
'id' => 'rid',
'table' => 'users_roles',
'field' => 'rid',
'relationship' => 'none',
),
'title' => array(
'label' => 'Title',
'link_to_node' => 0,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'relationship' => 'none',
),
));
$handler->override_option('filters', array(
'rid' => array(
'operator' => 'or',
'value' => array(
'3' => '3',
),
'group' => '0',
'exposed' => TRUE,
'expose' => array(
'use_operator' => 0,
'operator' => 'rid_op',
'identifier' => 'rid',
'label' => 'User: Roles',
'optional' => 1,
'single' => 1,
'remember' => 0,
'reduce' => 1,
),
'id' => 'rid',
'table' => 'users_roles',
'field' => 'rid',
'relationship' => 'none',
'reduce_duplicates' => 0,
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('items_per_page', 0);
$handler->override_option('distinct', 1);

Comments

merlinofchaos’s picture

Status: Active » Fixed

Yup, A check against 'limit to list' wasn't being performed so it was trying to do that incorrectly. Good catch!

Fixed in CVS.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.