Skip to content
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

QueryChecker issue #360

Closed
marioprudhomme opened this issue Jul 20, 2017 · 4 comments
Closed

QueryChecker issue #360

marioprudhomme opened this issue Jul 20, 2017 · 4 comments
Labels

Comments

@marioprudhomme
Copy link

Does anyone know what the $relationship variable is supposed to contain?

https://github.com/api-platform/core/blob/master/src/Bridge/Doctrine/Orm/Util/QueryChecker.php#L145

I'm having an issue where in my case, the variable contains this string '\AppBundle\Entity\ServiceTranslation' with no period. Causing an undefined index error due to the explode('.')

More info: DigitalState/Services#23

@StephenOTT
Copy link

@dunglas any ideas on this?

@soyuka
Copy link
Member

soyuka commented Jul 26, 2017

Something like foo.bar. Would it be possible to have the DQL responsible for the failure?

@marioprudhomme
Copy link
Author

marioprudhomme commented Aug 2, 2017

DQL:
SELECT o
FROM AppBundle\Entity\Service o
LEFT JOIN AppBundle\Entity\ServiceTranslation o_t WITH o.id = o_t.translatable
ORDER BY o_t.title ASC

SQL:
SELECT a0_.id AS id_0, a0_.uuid AS uuid_1, a0_.owner AS owner_2, a0_.owner_uuid AS owner_uuid_3, a0_.slug AS slug_4, a0_.enabled AS enabled_5, a0_.weight AS weight_6, a0_.version AS version_7, a0_.deleted_at AS deleted_at_8, a0_.created_at AS created_at_9, a0_.updated_at AS updated_at_10
FROM app_service a0_
LEFT JOIN app_service_trans a1_ ON (a0_.id = a1_.translatable_id)
ORDER BY a1_.title ASC LIMIT 10 OFFSET 0

The content of $relationship variable found at https://github.com/api-platform/core/blob/master/src/Bridge/Doctrine/Orm/Util/QueryChecker.php#L144:
"AppBundle\Entity\ServiceTranslation"

The error occurs when I'm adding the ORDER BY clause.

@Simperfit
Copy link
Contributor

Does @soyuka's patch fix this issue @mario-digitalstate ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants