phpcr-odm icon indicating copy to clipboard operation
phpcr-odm copied to clipboard

Reorder with rename test

Open dantleech opened this issue 11 years ago • 3 comments

This is a failing test, is it valid behavior?

dantleech avatar Apr 17 '13 12:04 dantleech

i think renames are only put into phpcr on flush. so the var_dumps can be expected to return the old name.

but i fear the reordering is taking shortcuts with phpcr to decide how to order things. what the right thing is depends on the order in which the UoW is telling phpcr about the move and the orderBefore. semantically i would expect the dm to handle that case properly. so depending on the execution order it either needs to update pending reorders when a move is detected maybe?

dbu avatar Apr 17 '13 14:04 dbu

maybe #449 could fix this, or at least will have an influence on this test. want to check on the #449 branch?

dbu avatar Mar 07 '14 15:03 dbu

i just investigated this a bit. from the way the children collection works, it is clear what happens. we ask phpcr for the list of children, but the rename is not put into the phpcr layer before the flush. if we want this to work, we would need to build a pending move table in the unit of work where explicit moves and move by assignment are tracked, and adjust the children mapping to be aware of that. even then, if you first would load the parent and then move the child, the children collection would still not see the move. i am afraid of the complexity we run into with such things. we have to figure out what the sane use cases are and stick to those.

dbu avatar Mar 14 '14 13:03 dbu