Hi,

I tried generating nodequeue assignments for a taxonomy queue with two empty subqueues. After generation, there're 10 nodes in each subqueue. Some of the nodes appeared more than once in each subqueue. After clicking "Generate" again, I got 20 nodes in each subqueue and 30 after clicking "Generate" the third time.

Note that each subqueue should have a different number of nodes in it.

Comments

ball.in.th’s picture

Please ignore this sentence in the issue:
After clicking "Generate" again, I got 20 nodes in each subqueue and 30 after clicking "Generate" the third time.

ezra-g’s picture

Title: generate_nodequeue places duplicate entries in subqueues » nodequeue_generate places duplicate nids in tax subqueues

Hmm. First, I see that the query that returns the nids to be added to a taxonomy smartqueue are hardcoded into nodequeue_generate.module (line 119 elseif ($queues[$subqueue->qid]->owner == 'smartqueue_taxonomy') { rather than being implemented as a hook, which is more appropriate.

Secondly, the query used is problematic: Rather than using a single "SELECT DISTINCT...WHERE {term_node.tid} IN(...)", query, it uses "WHERE term_node.tid =", and then loops over the results,without checking whether the nid is a duplicate, so you'll get duplicate nodes where a single node is assigned multiple terms.

I'd accept a patch for this, though I don't see myself fixing it in the immediate short term.

amateescu’s picture

Version: 6.x-2.0 » 7.x-2.x-dev
Status: Active » Fixed

Status: Fixed » Closed (fixed)

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