Using "Limit list to selected items" on exposed filters not working
esllou - July 4, 2009 - 13:20
| Project: | Views |
| Version: | 6.x-2.6 |
| Component: | User interface |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
1. Create view by content type. Many content types present on site.
2. Expose "Content type" filter.
3. User selects content type, presses "submit"...only those content types are returned. All OK.
4. Edit view, alter "Is one of" only to Video, Audio, Image. Choose "limit list to selected items".
5. Exposed filter contains only those three content types but on loading the view page, all content types returned.
Here is a very simple view to duplicate this behaviour:
$view = new view;
$view->name = 'viewtest';
$view->description = 'test';
$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(
'title' => array(
'label' => 'Title',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'link_to_node' => 1,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'relationship' => 'none',
),
'type' => array(
'label' => 'Type',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'link_to_node' => 0,
'exclude' => 0,
'id' => 'type',
'table' => 'node',
'field' => 'type',
'relationship' => 'none',
),
));
$handler->override_option('sorts', array(
'totalcount' => array(
'id' => 'totalcount',
'table' => 'node_counter',
'field' => 'totalcount',
),
));
$handler->override_option('filters', array(
'type' => array(
'operator' => 'in',
'value' => array(
'image' => 'image',
'audio' => 'audio',
'video' => 'video',
),
'group' => '0',
'exposed' => TRUE,
'expose' => array(
'use_operator' => 0,
'operator' => 'type_op',
'identifier' => 'type',
'label' => 'Node: Type',
'optional' => 1,
'single' => 1,
'remember' => 0,
'reduce' => 1,
),
'id' => 'type',
'table' => 'node',
'field' => 'type',
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler->override_option('items_per_page', 30);
$handler->override_option('use_pager', '1');
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
'grouping' => '',
'override' => 1,
'sticky' => 1,
'order' => 'asc',
'columns' => array(
'title' => 'title',
'type' => 'type',
),
'info' => array(
'title' => array(
'sortable' => 1,
'separator' => '',
),
'type' => array(
'sortable' => 1,
'separator' => '',
),
),
'default' => '-1',
));
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'test-view');
$handler->override_option('menu', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
));
#1
I am having the same problem, with an exposed filter is showing all roles, although I have it set to limit the roles shown. This view has been working fine for about a year. I upgraded from version 6.x-2.2 to 6.x-2.6 just today and that broke it.
#2
I did some investigation and when I export my view I see that reduce is set to "0", even though I have "Limit list to selected items" checked. What could cause that?
'value_1' => array(
'operator' => 'in',
'value' => array(),
'group' => '0',
'exposed' => TRUE,
'expose' => array(
'use_operator' => 0,
'operator' => 'value_1_op',
'identifier' => 'value_1',
'label' => 'Department',
'optional' => 1,
'single' => 1,
'remember' => 0,
'reduce' => 0,
),
#3
try changing that manually and re-importing it. Does it now behave as you expect?
#4
Hi
I have same problem. Reimporting after manual change to reduce value makes no difference.
Thanks
#5
I am also having this issue with content types exposed. It would be great to know if anyone is working on this issue.
#6
I had Acquia support look at this and their Views guru said it is a bug and that she would be putting up her findings.
#7
I also am experiencing this behavior. Views 6.x-2.6 w/ Drupal 6.13
#8
Same with me, though it worked some day earlier; started experiencing errors when working with the following options today:
- more displays in the view either overriding or not
- adding a tabbed menu from two or three displays
- adding Attachment display
Greetings
#9
How do I "limit list to selected items" for Drupal 5?
#10
Restoring version and category.
Please raise as a new issue if needed, and for the correct version rather than downgrade the version of an existing issue.