Closed (duplicate)
Project:
Nodequeue
Version:
6.x-2.9
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Feb 2010 at 20:19 UTC
Updated:
2 May 2011 at 12:55 UTC
Jump to comment: Most recent file
Comments
Comment #1
mcarbone commentedI'm having a similar problem, which is that if you add a node to a queue which already has that node, in the database, it adds two duplicate nodes into the queue, whereas in the UI, it only shows one. Thus, for a 5 item queue, you'll see only 4 items listed in the UI, but in the database you'll see 5 (including the duplicate). The nodequeue listing table will also accurately say the queue is full, even though from the perspective of the drag-and-drop page you only see 4 items. Lastly, things get pushed off unpredictably. I see two solutions for this:
1) Disabling duplicate node adds, either from the autocomplete, as GregoryHeller suggested, or throwing an error; or
2) Allowing duplicate node adds, but then displaying the node twice in the drag-and-drop interface, so it acts as the user expects.
Comment #2
dboulet commentedSame problem here, this gets to be very confusing for users.
Could we maybe add an option for queues to allow or disallow duplicates, and implement the options from above based on the chosen option?
Comment #3
dboulet commentedThis patch filters out nodes from the autocomplete results. I don't know if there's a better way to do this, as my way adds an extra db query which can't be great for performance.
Comment #4
mcarbone commentedWorks as advertised. However, it's sufficient to use just sqid (subqueue ID's are unique) in the WHERE query there, and that will be fast since it is indexed.
If this is the solution we go with, we should probably create a new ticket to implement option 2 above as a per-nodequeue option ("allow duplicates").
Comment #5
dboulet commentedThanks for the review mcarbone, new patch attached.
Comment #6
mcarbone commentedLooks good to me. Once the maintainer commits, I'll create a new ticket for option #2.
Comment #7
jiv_e_old commentedSame issue:
http://drupal.org/node/1022998
http://drupal.org/node/1062014
I think this solution is not the best. If you would add nodes dynamically via code the problem would still appear. Conseptually it would be right to check for dublicates in nodequeue_subqueue_add function and return an error if needed.
Additionally we could filter out already included nodes from autocomplete field. But I think there's no need to do it.
The basic idea is the same as in http://drupal.org/node/1022998. I'll attach my patch there.
Comment #8
amateescu commentedClosing as a duplicate of #593468: adding the same node more than once to a queue causes bad behavior. Will deal over there with all this node duplication madness :)