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

add failing test for #659

Open uwej711 opened this issue 9 years ago • 6 comments

so there a two conditions to make that test fail

  1. add an preUpdate Listener to the parent class
  2. make sure the parents ChildrenCollection is initialized without either one of these conditions the test passes!

uwej711 avatar Sep 18 '15 21:09 uwej711

when we restrict preUpdate to fields only, there remains one failing test (see travis). Not sure, if this is the way to go. But I see no other simple solution for #659. I think it would be safer anyway to restrict the possible changes to a documents fields as there a no other changesets computed after the event. But that currently leaves us with no way to reset the order of children (maybe this should be allowed).

uwej711 avatar Sep 21 '15 08:09 uwej711

I think this needs some discussion ...

uwej711 avatar Sep 30 '15 09:09 uwej711

events during the flush seem to be a really tricky beast. do you see a way to allow field updates and reorderings, but no renaming? or could we store the renaming operation in a way that the second changeset calculation can check if something was renamed and not get confused?

could we look at object identity rather than paths? uuid would only be something for 2.0 as we would change everything to have a uuid.

dbu avatar Oct 09 '15 16:10 dbu

I can try to look into the reordering but I fear this will not be an easy thing to fix.

uwej711 avatar Oct 09 '15 19:10 uwej711

what are our other options? limiting event listener to update properties?

dbu avatar Oct 10 '15 07:10 dbu

That's already done here, with the one test about reverting the reordering of the children in preUpdate failing, i.e. that would be a bc break of some kind.

uwej711 avatar Oct 11 '15 19:10 uwej711