mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
COUNT entities with OneToOne as identifier does not work since 2.5 #5224
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 @olexp on GitHub (Aug 18, 2016).
Originally assigned to: @guilhermeblanco on GitHub.
I have an entity with Id as OneToOne to another entity.
ZfcDatagrid uses query builder as data source and creates following query to check if data is available:
SELECT COUNT(m) FROM Setup\Entity\MailList m INNER JOIN m.product p
Starting from 2.5.0 query returns an error:
The last version where this query is working is 2.4.8.
Please help to find out what is wrong.
@JCMais commented on GitHub (Aug 18, 2016):
Can you try
SELECT COUNT(m.id) ...?@olexp commented on GitHub (Aug 18, 2016):
It works on m.product in 2.5.0 and 2.5.4.
Is it expected behavior? Whatever ZfcDatagrid gets is QueryBuilder instance and it may too much work to detect how to count entities.
@dtdigio commented on GitHub (Nov 27, 2017):
I have the same issue using FOSElasticaBundle. Like pointed out in #4541, there is a change that fixes this. Reverting commit
097840d. But this may break other things. Are there any plans to fix this in the near future?@lcobucci commented on GitHub (Nov 27, 2017):
This seems to be related to https://github.com/doctrine/doctrine2/pull/6701 but kind of unsure, could someone send us a failing test case that reproduces that behaviour? It would help us a lot to identify and fix the issue you're describing.
You can find examples on
388afb46d0/tests/Doctrine/Tests/ORM/Functional/Ticket@olexp commented on GitHub (Mar 31, 2020):
I hit it again. I've created test for 2.7 branch
6a25221328