reverse in admin view breaks drag-n-drop ordering
| Project: | Nodequeue |
| Version: | 6.x-2.x-dev |
| Component: | User interface |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
In #234004: Drag and drop node ordering the drag and drop user interface to reorder items in a queue was fixed. This indeed works ok for your average queue. If you switch on 'reverse in admin view' to have the nodes enter on top and leave from the bottom of the queue, the dag and drop sorting messes up the order of the queue.
I installed nodequeue-6.x-2.x-dev on a fresh 6.14 install.
Created a couple of nodes.
created a nodequeue and added 4 nodes to it.
mysql> select * from nodequeue_nodes where qid=1 order by position;
+-----+------+------+----------+------------+
| qid | sqid | nid | position | timestamp |
+-----+------+------+----------+------------+
| 1 | 1 | 1 | 1 | 1254856996 |
| 1 | 1 | 2 | 2 | 1254856996 |
| 1 | 1 | 3 | 3 | 1254856996 |
| 1 | 1 | 4 | 4 | 1254856996 |
+-----+------+------+----------+------------+
4 rows in set (0.00 sec)Now switch on 'reverse in admin view'
Go to the nodequeue edit screen /admin/content/nodequeueq/1/view
Node 4 is show on top of the queue, followed by 3, 2 and node 1 at the bottom
Now drag node 4 to the bottom of the list and save.
I would expect the result to be node 3, 2, 1, 4
However, the result is node 4, 1, 2, 3
In the database:
mysql> select * from nodequeue_nodes where qid=1 order by position;
+-----+------+------+----------+------------+
| qid | sqid | nid | position | timestamp |
+-----+------+------+----------+------------+
| 1 | 1 | 3 | 1 | 1254857039 |
| 1 | 1 | 2 | 2 | 1254857039 |
| 1 | 1 | 1 | 3 | 1254857039 |
| 1 | 1 | 4 | 4 | 1254857039 |
+-----+------+------+----------+------------+
4 rows in set (0.00 sec)Looks like the reversed view is being stored as the desired order.

#1
Thanks for taking the time to do this on a fresh install and for the clear error report. I marked http://drupal.org/node/576380 as a duplicate of this.
Indeed, we'll want to fix this, keeping in mind both the javascript and degradable functionality. We probably want to check whether the save button or the reverse button was clicked when the form is being submitted, and then perform an additional (server-side) reverse of the queue order before sending it to nodequeue_save_subqueue_order.
#2
I just ran into this a couple of minutes ago. I created a video to show what is hapening on my system after checking "Reverse in admin view"
http://screencast.com/t/yVh5FtbUS
Regards, Tom
#3
Glad to see this already being worked on. Discovered the same thing. Fairly simple to work around if you understand what is happening but users are easily confused.
#4
Actually, I think I was mistaken about how this can be fixed. It seems like we'll need to do two things:
1) For non-JS users, In theme_nodequeue_arrange_subqueue_form() the table should sort on subqueue position ascending, if the queue is reversed.
2) We'll want to update the displayed position value for JS users probably by modifying Drupal.behaviors.nodequeueReverse .
#5
I just discovered this bug as well. The only way to prevent my nodequeues from reversing their order constantly was to turn off "reserve in admin."
Seeing as though that feature is basically broken, shouldn't this be marked critical?
#6
I noticed this behaviour as well, any new ideas?
#7