orm
orm copied to clipboard
Add a failing test for #10514
Here is a failing test for #10514. The commit that causes breakage is e5e674c68630c38d7da5241ffc316c5fb18edfec, the parent commit still works.
The fix might be something like this, but if I apply it the test fails with a schema error. Can you have a look?
--- a/lib/Doctrine/ORM/UnitOfWork.php
+++ b/lib/Doctrine/ORM/UnitOfWork.php
@@ -3157,7 +3157,11 @@ class UnitOfWork implements PropertyChangedListener
*/
public function tryGetById($id, $rootClassName)
{
- $idHash = implode(' ', (array) $id);
+ $class = $this->em->getClassMetadata($rootClassName);
+ $idHash = implode(' ', $class->containsForeignIdentifier || $class->containsEnumIdentifier
+ ? $this->identifierFlattener->flattenIdentifier($class, (array) $id)
+ : (array) $id
+ );
return $this->identityMap[$rootClassName][$idHash] ?? false;
}
Will do but can happen next wednesday in the best case
Friendly ping @mpdude
Ouch, lost sight of this, sorry. I'm about to leave for summer vacation and not sure how much I can help in the next three to four weeks.
I have the (yet to be proven) impression that there are several places dealing with "id hash" computation, and that a few of them were touched in the last months when either backed enums and/or objects-as-id-values came into play.
Maybe it might be worthfile to go out looking for usages/patterns and see if we can consolidate this.
The place Nicolas is referring to also looks to be related to it, and the patch suggested does not apply since the changes from #10508.
Another friendly ping @mpdude (We are unable to migrate to later versions of Doctrine because of this bug. It is a major breaking issue for our whole application).
There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. If you want to continue working on it, please leave a comment.
This pull request was closed due to inactivity.