mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Entities with custom DBAL type identifier bound to DQL query parameters are not converted through DBAL types #6489
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 @Ocramius on GitHub (Jun 11, 2020).
Bug Report
Binding DQL query parameters to entities with primary key being mapped with a custom DBAL type does not lead to the identifiers being passed through the DBAL type conversion when the query is executed.
Summary
Given:
and
When calling:
Current behavior
The above will report zero results.
Expected behavior
The above should report one result
@ambroisemaupate commented on GitHub (Nov 29, 2020):
Same issue on
2.8.x-devIt seems that QueryBuilder tries to serialize object instead of using its primary key:
To fix this I need to use
$node->getId():