Problem/Motivation
1. create a new entity queue for nodes with "Simple queue" type. Enable the "Reverse order in admin view" option.
2. create nodes: node1, node2, node3, node4
3. add node1 to the queue with the 'Add item' button
4. add node2 to the queue with the 'Add item' button
5. add node3 to the queue with the 'Add item' button
6. add node4 to the queue with the 'Add item' button
Expected results are in this order:
node4
node3
node2
node1
Actual results in the table are in this order:
node4
node2
node1
node3
The whole queue is reversed when I remove entries, too. Steps to reproduce that:
1. Make sure the queue has these elements displayed in the table in this order:
node4
node3
node2
node1
2. remove node3
Expected results are in this order:
node4
node2
node1
Actual results in the table are in this order:
node1
node2
node4
Proposed resolution
It looks like when I click to a button and there's an AJAX request on that form and the "Reverse order in admin view" is enabled, it reverses the whole queue every time. Even when it was reversed before. Checking for the triggering element in the form could fix this behavior.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 3093203-8.patch | 16.27 KB | amateescu |
| #6 | interdiff-2-6.txt | 1.94 KB | sdstyles |
| #6 | subqueue-order-flips-after-reordering-3093203-6.patch | 3.18 KB | sdstyles |
Comments
Comment #2
kaszarobertComment #3
ocastle commentedI also have this same issue, but the patch doesn't quite fix it for me.
The order isn't (re)reversed upon adding a new item, which works, but the new item is added to the top of the list instead of the bottom...
Comment #4
ocastle commentedComment #5
maseyuk commentedThanks the patch in #2 works well
Comment #6
sdstyles commentedPatch #2 apparently works fine, its covering the use case when only new items are added to subqueue, the real chaos starts when you have reordered items, and a new one is added, the items order are mixed with each new added item.
I updated #2 to keep item weight order, for existing (not saved) reordered items, and newly added.
IMHO since queue is reversed new items should be added on top of others.
Comment #7
sdstyles commentedComment #8
amateescu commentedI've been looking into this in the past few days and, as the great issue summary says, the current
reverse_in_adminfeature is quite broken and kind of useless IMO, so I'd like to introduce a newreversesetting that works at the storage level, not just in the UI.Can you try out this patch and let me know if everything works as expected?
Comment #9
amateescu commentedAdding credit to @toxaviking who has been working on a very similar approach #3120866: Ability to add items to the front of the list and delete items at the bottom.
Comment #11
amateescu commentedComment #12
amateescu commentedWrote a change record for this since it is a breaking change that we can't cover with an automatic upgrade path, and committed the patch from #8 to 8.x-1.x.