mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #546] [MERGED] The EntityManager was not injected in uninitialized proxys which are Obj... #8350
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/doctrine/orm/pull/546
Author: @stefankleff
Created: 1/10/2013
Status: ✅ Merged
Merged: 1/12/2013
Merged by: @beberlei
Base:
master← Head:hotfix/injectObjectManagerInProxy📝 Commits (3)
151192aThe EntityManager was not injected in uninitialized proxys which are ObjectManagerAware.dc925ccfixed indentation6032e3eAdded test📊 Changes
2 files changed (+113 additions, -4 deletions)
View changed files
📝
lib/Doctrine/ORM/UnitOfWork.php(+10 -4)➕
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2231Test.php(+103 -0)📄 Description
...ectManagerAware.
I ran into that problem while I had two objects in the identitymap while hydrating a collection: one was new a "real" entity and the other one was an uninitialized proxy. For "real" entities the em is injected in line 2427, for new entities it is injected in 2436->2364, but for proxies this is missing. According to the comment "inject ObjectManager into just loaded proxies." the code in line 2427 should do this, but in fact it is just used if it is a "real" entity or an already initialized proxy. Moving the injection to outside of the condition in line 2411 (if the entity is an unitialized proxy) solves this.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.