mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #5714] Fix loading of association with quoted JoinColumn #9701
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?
Original Pull Request: https://github.com/doctrine/orm/pull/5714
State: closed
Merged: No
Consider this entity
Loading this entity fails with error
ErrorException: Undefined index: order in...\lib\Doctrine\ORM\Utility\IdentifierFlattener.php:92. The problem is, that data that goes to UoW::createEntity and toflattenIdentifierlook like thisnote the backticks around order
If the
ordercolumn was generic@Column, the backticks would not be thereIf
orderwas association but not an ID, the loading would not fail, but silently leave$order = nullThe root cause, I think, is in method BaseEntityPersister::getSelectColumnAssociationSQL, where column name added to ResultSetMapping is the quoted version for JoinColumn, but for other ordinary columns it adds non-quoted version. The quoted version is then passed from ObjectHydrator to uow::createEntity and produces the error
This pull should fix the problem, although I'm not entirely sure if this is the only place with this issue.