mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Partial object children in cache #7180
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 @duzenko on GitHub (Jul 11, 2023).
Bug Report
Summary
Partial objects break object caching
Current behavior
Incomplete joined objects from partial selects save to cache and later are reused without actual data fetch
How to reproduce
Partial select with join. In this case 'lc.auction la' is the no-data object that is saved to cache
Later in the same PHP call, but very different class I try to load the auction
The auction itself loads OK, but its nested contracts collection only has id's, all other fields are null.
Auction and contracts link to each other via a one-to-many and many-to-one relations.
There may be a bug in the code that checks the 'initialized' state of the partial contract entity that prevents it to load the second time.
So either prevent the auction entity from saving to cache, or make the partial contract entity to reload on next fetch.
Expected behavior
The partial objects do not save to cache and are fully loaded on subsequent requests