I have two filters on node type. One that selecting only the nodetypes i want to view. And another exposed filter on nodetype.

If i don't select any value in the exposed filter everything works fine. And i only get my selected nodetypes in the list. But if i select a nodetype in the exposed filter. The exposed value isn't passed in the sql questions. It just get marked as ''.

Without exposed filter. Working

SELECT node.nid AS nid,
   node.title AS node_title,
   node.type AS node_type
 FROM node node 
 WHERE (node.type in ('company', 'contact', 'medlemsforening')) AND (node.status <> 0)
   ORDER BY node_title ASC

With exposed filter, not working just passing '' instead of exposed filter value

SELECT node.nid AS nid,
   node.title AS node_title,
   node.type AS node_type
 FROM node node 
 WHERE (node.type in ('company', 'contact', 'medlemsforening')) AND (node.type in ('')) AND (node.status <> 0)
   ORDER BY node_title ASC

Comments

merlinofchaos’s picture

Status: Active » Postponed (maintainer needs more info)

It's not clear to me what you're actually selecting in the exposed filter that achieves this result.

Also can you export the view and paste it between php tags, please? Then return this issue to 'active'.

freakalis’s picture

Status: Postponed (maintainer needs more info) » Active

Sure, here is the export.

$view = new view;
$view->name = 'views_test';
$view->description = '';
$view->tag = '';
$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' => 'Titel',
    'link_to_node' => 0,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
  ),
  'type' => array(
    'label' => 'Typ',
    'link_to_node' => 0,
    'exclude' => 0,
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
  'type_1' => array(
    'operator' => 'in',
    'value' => array(
      'contact' => 'contact',
      'medlemsforening' => 'medlemsforening',
      'organisation' => 'organisation',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type_1',
    'table' => 'node',
    'field' => 'type',
    'relationship' => 'none',
  ),
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'contact' => 'contact',
      'medlemsforening' => 'medlemsforening',
      'organisation' => 'organisation',
    ),
    'group' => '0',
    'exposed' => TRUE,
    'expose' => array(
      'use_operator' => 0,
      'operator' => 'type_op',
      'identifier' => 'type',
      'label' => 'Nod: Typ',
      'optional' => 1,
      'single' => 0,
      'remember' => 0,
      'reduce' => 1,
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
  'role' => array(),
  'perm' => '',
));
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
  'grouping' => '',
  'override' => 1,
  'sticky' => 0,
  'order' => 'asc',
  'columns' => array(
    'title' => 'title',
    'type' => 'type',
  ),
  'info' => array(
    'title' => array(
      'sortable' => 1,
      'separator' => '',
    ),
    'type' => array(
      'sortable' => 1,
      'separator' => '',
    ),
  ),
  'default' => '-1',
));

The filter works if don't select any value in the exposed filter. But if i select any value in the exposed it doesn't return any value att all.

merlinofchaos’s picture

Status: Active » Fixed

Thanks for the view; I successfully reproduced this and fixed the error in CVS. It'll go out with the next dev rebuild which will be at midnight GMT and will be in rc3.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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