mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-3872: Using InheritanceType entity with orderBy in query facing error #4740
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 @doctrinebot on GitHub (Aug 11, 2015).
Originally assigned to: @guilhermeblanco on GitHub.
Jira issue originally created by user aistis:
If you have two classes like:
The following error is thrown:
{quote}
An exception has been thrown during the rendering of a template ("An exception occurred while executing 'SELECT DISTINCT id_14 FROM (SELECT c0_.username AS username_0, c0_.username_canonical AS username_canonical_1, c0_.email AS email_2, c0_.email_canonical AS email_canonical_3, c0_.enabled AS enabled_4, c0_.last_login AS last_login_5, c0_.locked AS locked_6, c0_.expired AS expired_7, c0_.expires_at AS expires_at_8, c0_.confirmation_token AS confirmation_token_9, c0_.password_requested_at AS password_requested_at_10, c0_.roles AS roles_11, c0_.credentials_expired AS credentials_expired_12, c0_.credentials_expire_at AS credentials_expire_at_13, c0_.id AS id_14, c0_.admin_locale AS admin_locale_15, c0_.password_changed AS password_changed_16, c0_.salt AS salt_17, c0_.password AS password_18, c1_.full_name AS full_name_19, c0_.discriminator AS discriminator_20 FROM some_user_clients c1_ INNER JOIN some_users c0_ ON c1_.id = c0_.id WHERE 1 = 1) dctrn_result ORDER BY c0_.email DESC LIMIT 20 OFFSET 0':
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'c0_.email' in 'order clause'") in SomeBundle::some.html.twig at line 10.
{quote}
It is caused by base entity subquery. The wrong
c0_.emailselector is used.@doctrinebot commented on GitHub (Aug 11, 2015):
Comment created by aistis:
I believe it is the same problem as http://stackoverflow.com/questions/29715104/error-with-orderby-column-not-found/30154357