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

Correct resolve DQL alias in context in SelectEntity #288

Merged
merged 1 commit into from
Jan 28, 2021

Conversation

peter-gribanov
Copy link
Member

@peter-gribanov peter-gribanov commented Jan 28, 2021

The path to the additional alias is specified without taking into account the root alias, and as a result, Doctrine does not know how to build joins.

Example

echo $rep->getQueryBuilder(Spec::addSelect(
    Spec::selectEntity('contestant.user'),
    Spec::selectEntity('contestant'),
))->getDQL();

Result

SELECT
    root,
    contestant.user,
    contestant
FROM
    Questionnaire root

Should be

SELECT
    root,
    user,
    contestant
FROM
    Questionnaire root
INNER JOIN
    root.contestant contestant
INNER JOIN
    contestant.user user

@peter-gribanov peter-gribanov mentioned this pull request Jan 28, 2021
37 tasks
@peter-gribanov peter-gribanov self-assigned this Jan 28, 2021
@peter-gribanov peter-gribanov added this to the Release 2.0.0 milestone Jan 28, 2021
@peter-gribanov peter-gribanov merged commit 9771bc9 into Happyr:2.0 Jan 28, 2021
@peter-gribanov peter-gribanov deleted the select_entity_in_context branch January 28, 2021 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant