Skip to content

Translation changesets and locale tracking #97

Merged
merged 13 commits into from Feb 3, 2012

2 participants

@lsmith77
Doctrine member
lsmith77 commented Feb 2, 2012

properly track document locale even if there is no @Locale annotated field.

@lsmith77 lsmith77 commented on the diff Feb 2, 2012
lib/Doctrine/ODM/PHPCR/UnitOfWork.php
@@ -692,7 +743,9 @@ public function computeChangeSet(ClassMetadata $class, $document)
if ($class->nodename == $fieldName) {
throw new PHPCRException('The Nodename property is immutable. Please use PHPCR\Session::move to rename the document: '.self::objToStr($document));
}
- if ($class->parentMapping == $fieldName) {
+ if ($class->parentMapping == $fieldName
+ && null !== $this->originalData[$oid][$fieldName]
@lsmith77
Doctrine member
lsmith77 added a note Feb 2, 2012

not sure why we previously didn't hit this issue, but without this change I ran into trouble with one test. I guess it was caused because the path was assigned manually, but the document had a parent annotation. So on the next flush it failed because suddenly there was a parent object.

@dbu
Doctrine member
dbu added a note Feb 3, 2012

we really should increase code coverage to be sure we test all the use cases. maybe you just happened to do a situation that was not tested before...

@lsmith77
Doctrine member
lsmith77 added a note Feb 3, 2012

hmm actually once we flush a document, we might want to always populate the parent with a proxy if there isn't anything set yet?

@lsmith77
Doctrine member
lsmith77 added a note Feb 3, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@dbu dbu merged commit 82ed2d2 into master Feb 3, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.