jackalope/jackalope-doctrine-dbal — pull request #37 by petesiss (2012-06-22 12:40:05+00:00)
Title: [WIP] moveNodes doesn't correct the sort order

Currently the moveNodes method doesn't consider the nodes sort_order field.

Hence if sort_order has been set then when the node is moved it maintains that sort_order value instead of being added to the end of the list of siblings.

I've written the move sql so that it can all happen in one query. Most of the sql is CASE statements to replicate the behaviour of the php dirname() that was previously being used in between the two queries.

It might be possible to remove some of the CASE's as maybe other checks are already in place to prevent e.g. a path of '.' or '//'?

Re the moveNodes not accounting for sort order, I'll add tests to show this. Is phpcr the best place for these? Or as part of the client? Also not sure whether theyre best as 'move' tests or 'order' tests as they will use both methods.