Right now the "Reverse in admin view" checkbox does not work when changing the positions of items in a queue. Every time you change the order (say move the first item to the second position), and save the queue, the entire queue is reversed and the item you meant to make second is now second from last instead.
This problem is because when a nodequeue is reversed in the admin view it correctly displays the items "reversed" (with the highest position number at the top of the list), but the Drupal tabledrag.js file will always sort items lowest to highest. So as soon as one item is moved, tabledrag.js effectively changes every item's position. Then when the queue is saved (by clicking the "Save" button), the result is that the entire queue gets reversed.
To fix this problem we should always number the queue position starting at "1" at the top of the list and the highest number at the bottom. Then when saving the node queue, we should reverse the order at that point. This makes it so that tabledrag.js can do it's thing normally without any special changes and the "Reverse in admin view" checkbox won't unexpectedly save the list in reverse if the order is changed.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | nodequeue_reverse_admin_fix.patch | 2.37 KB | quicksketch |
| nodequeue_reverse_admin_fix.patch | 1.83 KB | quicksketch |
Comments
Comment #1
quicksketchComment #2
sirkitree commentedsubscribe
Comment #3
quicksketchMy last patch had an issue in that if you tried to use the "Remove" link it would end up removing the last item in the queue, rather than the item that had been explicitly removed.
Comment #4
drupalninja99 commentedthis isnt working for me it still shuffles the order
Comment #5
drupalninja99 commentedi first tested your patch against the dev version and it wasnt working so i reverted it back to just the dev version and that works.
Comment #6
amateescu commentedThis is fixed in both 6.x and 7.x.
Comment #7
ezra-g commented@amateescu - Where did this get fixed?
Comment #8
amateescu commented@ezra-g:
6.x - http://drupal.org/node/597498#comment-3439650
7.x - http://drupal.org/node/1097962#comment-4424492