I'm attempting to use the filter "Nodequeue queue: (is none of) (queue name)". I can't seem to get it to remove the nodes from the list that are in the queue I specify. All the view consist of is a filter for content type and a sort of updated time. Any suggestions would be helpful.
Thank you!

Comments

ezra-g’s picture

Can you export the view and paste it in here inside of code tags?

mnapier’s picture

Sure can. Thank you!

  $view = new stdClass();
  $view->name = 'latest_news';
  $view->description = 'List of latest news';
  $view->access = array (
);
  $view->view_args_php = '$offset = 0;';
  $view->page = FALSE;
  $view->page_title = '';
  $view->page_header = '';
  $view->page_header_format = '1';
  $view->page_footer = '';
  $view->page_footer_format = '1';
  $view->page_empty = '';
  $view->page_empty_format = '1';
  $view->page_type = 'node';
  $view->url = '';
  $view->use_pager = TRUE;
  $view->nodes_per_page = '10';
  $view->block = TRUE;
  $view->block_title = '';
  $view->block_header = '<div class="main-sub-story">';
  $view->block_header_format = '3';
  $view->block_footer = '</div>';
  $view->block_footer_format = '3';
  $view->block_empty = '';
  $view->block_empty_format = '1';
  $view->block_type = 'list';
  $view->nodes_per_block = '9';
  $view->block_more = FALSE;
  $view->block_use_page_header = FALSE;
  $view->block_use_page_footer = FALSE;
  $view->block_use_page_empty = FALSE;
  $view->sort = array (
    array (
      'tablename' => 'node',
      'field' => 'changed',
      'sortorder' => 'DESC',
      'options' => 'normal',
    ),
  );
  $view->argument = array (
  );
  $view->field = array (
    array (
      'tablename' => 'node',
      'field' => 'title',
      'label' => '',
      'handler' => 'views_handler_field_nodelink',
      'options' => 'link',
    ),
    array (
      'tablename' => 'node_comment_statistics',
      'field' => 'comment_count',
      'label' => '',
      'handler' => 'views_handler_field_int',
    ),
    array (
      'tablename' => 'node',
      'field' => 'changed',
      'label' => '',
      'handler' => 'views_handler_field_since',
    ),
    array (
      'tablename' => 'node',
      'field' => 'nid',
      'label' => '',
    ),
  );
  $view->filter = array (
    array (
      'tablename' => 'node',
      'field' => 'type',
      'operator' => 'OR',
      'options' => '',
      'value' => array (
  0 => 'editorial',
),
    ),
    array (
      'tablename' => 'node',
      'field' => 'distinct',
      'operator' => '=',
      'options' => '',
      'value' => array (
  0 => 'distinct',
),
    ),
    array (
      'tablename' => 'nodequeue_nodes',
      'field' => 'qid',
      'operator' => 'NOR',
      'options' => '',
      'value' => array (
  0 => '24',
),
    ),
  );
  $view->exposed_filter = array (
  );
  $view->requires = array(node, node_comment_statistics, nodequeue_nodes);
  $views[$view->name] = $view;
mnapier’s picture

Did this help any?

Thank you!

yelvington’s picture

Component: User interface » Code

Changing from "user interface" to "code."

Here is the actual example that Mike and I are looking at right now.

Filters:
Nodequeue: Queue "is none of" "lead: story"
Node: Published Equals "Yes"
Node:type "Is One of" Editorial Node
Node: Distinct is distinct

We had to add the distinct select because the query was returning multiple instances of the same node.
With or without that filter, the query returns a node that is CLEARLY in the "Lead: Story" nodequeue.

Here is the generated SQL:

SELECT DISTINCT(node.nid), node.changed AS node_changed_changed FROM {node} node LEFT JOIN {nodequeue_nodes} nodequeue_nodes ON node.nid = nodequeue_nodes.nid WHERE ((nodequeue_nodes.qid NOT IN ('24') OR nodequeue_nodes.qid IS NULL)) AND (node.status = '1') AND (node.type IN ('editorial')) GROUP BY node.nid, node_changed_changed ORDER BY node_changed_changed DESC

Note this: ((nodequeue_nodes.qid NOT IN ('24') OR nodequeue_nodes.qid IS NULL))

yelvington’s picture

Update: Here's where the generated code fails. If a node is in more than one nodequeue, the test evaluates to TRUE even though that's not what was requested in the filter UI.

Not knowing anything about the internals of the module, it's hard to tell if this is specifically a nodequeue issue, or a core Views code-generator issue.

joachim’s picture

I'm seeing this bug too.

I'm guessing that views can't form the query that would be needed.
What DOES work is the next filter down, "is not in a queue" which I always thought meant "not in ANY queue" but gives a list to choose from.

So reallly, the "is none of" option should be removed. So should "is any of", as it's a single selector so you can't select several things to be in anyway!

OpenChimp’s picture

I agree that the is none of option is confusing. There's an older issue that demonstrates this same confusion - http://drupal.org/node/247314. If there's no reason to use it, it should be removed so that users will try the "Nodequeue: not in a queue" option.

ezra-g’s picture

Status: Active » Closed (won't fix)

Drupal 5 is no longer a supported core version.