Hi,
I'm using Views 3 on Drupal 7 and i'm trying to create a block to show nodes tagged with 'download' from 2 separate vocab i have setup.
Adding only one to the views filter works but when trying to add another one, it produces no results.
This is what i have:
Filter criteria
---------------
Content: Has taxonomy term (= download) {this one is filtering on blog tag vocab}
Content: Has taxonomy term (= download) {this one is filtering on tutorials tag vocab}
If i have only one in the filter, it works but not both. Perhaps, i'm not using the filter correctly?
Here's my exported views:
$view = new view;
$view->name = 'download_block';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'Download block';
$view->core = 7;
$view->api_version = '3.0-alpha1';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Downloads';
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['query']['options']['distinct'] = TRUE;
$handler->display->display_options['query']['options']['query_comment'] = FALSE;
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'some';
$handler->display->display_options['pager']['options']['items_per_page'] = '5';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['style_plugin'] = 'list';
$handler->display->display_options['row_plugin'] = 'fields';
/* Field: Content: Title */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['label'] = '';
$handler->display->display_options['fields']['title']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['title']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['title']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = 0;
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = 0;
$handler->display->display_options['fields']['title']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['title']['alter']['trim'] = 0;
$handler->display->display_options['fields']['title']['alter']['html'] = 0;
$handler->display->display_options['fields']['title']['hide_empty'] = 0;
$handler->display->display_options['fields']['title']['empty_zero'] = 0;
$handler->display->display_options['fields']['title']['link_to_node'] = 1;
/* Sort criterion: Content: Post date */
$handler->display->display_options['sorts']['created']['id'] = 'created';
$handler->display->display_options['sorts']['created']['table'] = 'node';
$handler->display->display_options['sorts']['created']['field'] = 'created';
$handler->display->display_options['sorts']['created']['order'] = 'DESC';
/* Filter criterion: Content: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 0;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Filter criterion: Content: Has taxonomy term */
$handler->display->display_options['filters']['tid']['id'] = 'tid';
$handler->display->display_options['filters']['tid']['table'] = 'taxonomy_index';
$handler->display->display_options['filters']['tid']['field'] = 'tid';
$handler->display->display_options['filters']['tid']['value'] = array(
208 => '208',
);
$handler->display->display_options['filters']['tid']['reduce_duplicates'] = 0;
$handler->display->display_options['filters']['tid']['type'] = 'select';
$handler->display->display_options['filters']['tid']['vocabulary'] = 'tags';
$handler->display->display_options['filters']['tid']['hierarchy'] = 1;
/* Filter criterion: Content: Has taxonomy term */
$handler->display->display_options['filters']['tid_1']['id'] = 'tid_1';
$handler->display->display_options['filters']['tid_1']['table'] = 'taxonomy_index';
$handler->display->display_options['filters']['tid_1']['field'] = 'tid';
$handler->display->display_options['filters']['tid_1']['value'] = array(
214 => '214',
);
$handler->display->display_options['filters']['tid_1']['reduce_duplicates'] = 0;
$handler->display->display_options['filters']['tid_1']['type'] = 'select';
$handler->display->display_options['filters']['tid_1']['vocabulary'] = 'tutorials_tags';
$handler->display->display_options['filters']['tid_1']['hierarchy'] = 1;
/* Display: Block */
$handler = $view->new_display('block', 'Block', 'block');
thanks,
Comments
Comment #1
dawehnerCan you show the generated sql? It general this should work from my perspective.
Comment #2
onejam commentedSorry i can't reproduce this issue again as i've changed the structure of the vocab but thanks for looking into it, much appreciated.
Comment #3
dawehnerOkay update status.
Comment #4
tj2653 commentedduvien - I know you changed your vocab structure, but it seems like your issue might have been similar to mine: http://drupal.org/node/1228280
Comment #6
Jason Dean commentedHi
I have the same issue as originally posted, using latest dev. My filter criteria looks like this:
Content: Published (Yes)
Content: Type (= Film)
Content: Has taxonomy term (= Festival) {filtering on 'type' vocabulary}
Content: Has taxonomy term (= 2011) {filtering on 'year' vocabulary}
This returns no results. If I remove one of the taxonomy term filters, results show fine.
Interestingly if I use filter 'Has taxonomy terms (with depth)' instead, the view works fine even when I use it twice. So problem seems to be to do with 'Has taxonomy term' filter?
Here's the SQL query:
Thanks
Comment #7
kars-t commentedHi
I am closing this issue to clean up the issue queue. Feel free to reopen the issue if there is new information and the problem still resides. If not please make sure you close your issues that you don't need any more.
Maybe you can get support from the local user group. Please take a look at this list at groups.drupal.org.
Comment #9
jtwalters commentedI know this is a really old thread, but I had the same issue and tried out the "Reduce Duplicates" option and that seemed to resolve the issue.