[PHPCR-98] replace child document Created: 22/Feb/13  Updated: 21/Jun/13  Resolved: 02/Mar/13

Status: Closed
Project: Doctrine PHPCR
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: David Buchmann Assignee: Lukas Kahwe
Resolution: Fixed Votes: 0
Labels: None


 Description   

when replacing a mapped child with a new document, we get the cannotMoveByAssignment exception, which imo is a) the wrong message as its not about setting a tracked document to become a child somewhere else but what we should do is delete the existing child document and add the new one.

this happens at https://github.com/doctrine/phpcr-odm/blob/master/lib/Doctrine/ODM/PHPCR/UnitOfWork.php#L1912

for multiple children, i am less sure how it should work, if it is possible the same way:
https://github.com/doctrine/phpcr-odm/blob/master/lib/Doctrine/ODM/PHPCR/UnitOfWork.php#L935



 Comments   
Comment by David Buchmann [ 22/Feb/13 ]

there is a PR to add a form element for an image. when using this, the containing class needs to work around this bug for now https://github.com/doctrine/DoctrinePHPCRBundle/pull/37

Comment by David Buchmann [ 02/Mar/13 ]

the PR got merged https://github.com/doctrine/phpcr-odm/pull/253

as a side note: what speaks against moving the issues to github and drop this jira project? it would be much more user friendly for reporting bugs, and easier to integrate. and i don't think we use any of the fancy jira features really. (github has tags and now even milestones, if we would want to use them)

Comment by David Buchmann [ 21/Jun/13 ]

note that as of this time, this is not fully fixed: if the child has children of its own, there is an error about detached documents. see https://github.com/doctrine/phpcr-odm/pull/262

Generated at Mon Dec 22 10:48:09 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.