mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Order of accessing related lazy loaded relations on closed entity manager #6106
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?
Originally created by @sserbin on GitHub (Nov 19, 2018).
Bug Report
Summary
Probably easier demonstrated via test case. Basically, if you have a loaded entity (a) and close em and it's relations(b,c) are not loaded yet and (b) relates to (c) then accessing(loading) methods on (c) first would break the internal (proxy?) state of (b). Accessing in order of (b),(c) however would work just fine
Current behavior
Order of operations matters
How to reproduce
https://gist.github.com/sserbin/bd0c685b90d8b73f5d04cbc2307c07bd
Expected behavior
Order of operation does not matter, internal object state is not lost/broken
upd: let me know if I should create a pull request with the test case (not sure on the process)
@Ocramius commented on GitHub (Nov 19, 2018):
Does this also apply to ORM
master?@sserbin commented on GitHub (Nov 19, 2018):
@Ocramius yes, although the behaviour is slightly different (it's almost the opposite of 2.6 except none of the orders works properly):
here's the full test file: https://gist.github.com/sserbin/1904116d9cd241af7af06f68569f7cad