I have a DD block that looks towards a view that has as its sort order the nodes' positions within a nodeque (the nodequeue is joined via a relationship in the view).
I have verified that the nodequeue passes it's order correctly to the view.
I have verified that the view, when rendered elsewhere, correctly orders the result nodes based on the nodequeue.
I have verified that the view's result array which ddblock receives has the nodes in the correct order.
The problem appears to be the use of asort and rsort. Based on my testing, these functions just look to the first property of the objects within the array when performing their sort. In this case, the first property of the node objects within the $view->result array is the nid, and so the sorting (whether performed by asort() or rsort()) is based on nid.
There are a number of functions out there that can sort arrays of objects based on a specified property, but that approach sounds like it is too complicated here. Would it be possible instead to offer a sort option on blocks so that no sorting is performed, i.e., the block's items are rendered in the order they are delivered by the $view->result array?
Comments
Comment #1
airen2011 commentedHave a look at: DDblock order and view order
Hope this helps you further, please let me know.
Comment #2
tim cullen commentedThanks for the quick reply! Sorry I didn't find this on my initial searches of the queue.