-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"The query returned a row containing multiple columns." using HYDRATE_SINGLE_SCALAR with a hidden column #9209
Comments
Can you please provide a stack trace? Read more on how to do so here: https://symfony.com/doc/current/contributing/code/stack_trace.html |
Is that you want ?
|
Yes, exactly 👍 |
So the exception comes from here:
Duplicate of #4257 , right? |
Duplicate of #4257 |
Reopening since #4257 is supposed to be fixed… @Mediagone maybe you can help with this? |
How can I know the target version into which the fix was merged? |
Here we can see that it was merged in 2.7: d83c0a6 , but weirdly, it does not show tag information It looks like your commit was merged in 2.7, but should have been merged in 2.7.x. I'm closing this and reopening the other issue then. |
Bug Report
Summary
While trying to get a list of ID for one entity, I tried to use
getResult(AbstractQuery::HYDRATE_SINGLE_SCALAR)
, one column is visible, the other is hidden, it seems an issue for Doctrine but it should work.Current behavior
Doctrine throws exception about multiple column selected while using HYDRATE_SINGLE_SCALAR but only one is visible, the other is hidden.
The error is
How to reproduce
Select 2 columns, one visible, other is hidden.
Get a list of first column, using
getResult(AbstractQuery::HYDRATE_SINGLE_SCALAR)
$qb->select('entity.id AS id');
$qb->select('entity.id AS HIDDEN otherId');
$idList = $qb->getQuery()->getResult(AbstractQuery::HYDRATE_SINGLE_SCALAR);
Expected behavior
I get a list of IDs with no error.
The text was updated successfully, but these errors were encountered: