Currently the "Not in queue" filter generates sql like so:
SELECT DISTINCT(node.nid), node.created AS node_created_created FROM {node} node LEFT JOIN {nodequeue_nodes} nodequeue_nodes ON node.nid = nodequeue_nodes.nid WHERE (node.status = '1') AND (node.type IN ('blog')) AND (node.promote = '1') AND (nodequeue_nodes.qid IS NULL OR nodequeue_nodes.qid != 4) GROUP BY node.nid, node_created_created ORDER BY node_created_created DESC
This only has the desired effect if the intended nodes are only eligible for a single queue. In the above sql, we are excluding nodes from queue ID #4, but if there are nodes in other queues (e.g. 1, 2 or 3) they will show up as results in this query, negating its effectiveness.
The only way I've found as yet to resolve this is to use mysql's GROUP_CONCAT function, which is mightly powerful, but not postgres friendly and a bit more resource intensive. The SQL for the same intended view as above would look like:
SELECT DISTINCT(node.nid), node.created AS node_created_created, GROUP_CONCAT(nodequeue_nodes.qid) as nodequeue_nodes_quids FROM {node} node LEFT JOIN {nodequeue_nodes} nodequeue_nodes ON node.nid = nodequeue_nodes.nid WHERE (node.status = '1') AND (node.type IN ('blog')) AND (node.promote = '1') GROUP BY node.nid, node_created_created HAVING (nodequeue_nodes_quids NOT LIKE '%4%' OR nodequeue_nodes_quids IS NULL) ORDER BY node_created_created
I don't have a great solution here, but wanted to kick off some discussion on how to allow for many queues on a site, but still retain the ability to effectively "strain out" nodes that are within a given queue.
Also, as it stands, there's no way to add HAVING statements, or to give computed values to fields within views. It may be a moot point. :(
Comments
Comment #1
merlinofchaos commentedThis is fixed by adding the qid to the JOIN statement.
Comment #2
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.