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

Safe prefix aliases for buildAssociationQuery() #4195

Merged
merged 1 commit into from May 8, 2017

Conversation

Projects
None yet
3 participants
@jfxninja
Contributor

jfxninja commented May 5, 2017

Consider the following

$I->seeInRepository(
'OrderItem',
array(
'order' => array(
'recipient_email'=> self::MEMBER_EMAIL
)
)
);

Generates the following query:

SELECT s FROM OrderItem s INNER JOIN s.order order WHERE order.recipient_email = :order__recipient_email

Currently fails with expected literal due to the use of the word order as an alias.

The suggested change would produce

SELECT s FROM OrderItem s INNER JOIN s.order _order WHERE _order.recipient_email = :_order__recipient_email

Fixes #4194

Safe prefix aliases for buildAssociationQuery()
Consider the following

   $I->seeInRepository(
        'OrderItem',
        array(
            'order' => array(
                'recipient_email'=> self::MEMBER_EMAIL
            )
        )
    );
Generates the following query:
SELECT s FROM OrderItem s INNER JOIN s.order order WHERE order.recipient_email = :order__recipient_email

Currently fails with expected literal.

The suggested change would produce
SELECT s FROM OrderItem s INNER JOIN s.order _order WHERE _order.recipient_email = :_order__recipient_email

@Naktibalda Naktibalda added the Doctrine label May 5, 2017

@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik May 8, 2017

Member

Strange that Doctrine didn't apply quotes to params...
Thanks for the fix

Member

DavertMik commented May 8, 2017

Strange that Doctrine didn't apply quotes to params...
Thanks for the fix

@DavertMik DavertMik merged commit d84b7d1 into Codeception:2.2 May 8, 2017

4 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
semaphoreci The build passed on Semaphore.
Details
wercker/build Wercker pipeline passed
Details
@jfxninja

This comment has been minimized.

Show comment
Hide comment
@jfxninja

jfxninja May 9, 2017

Contributor

Happy to help! Any idea when this will be available in a tag so I can include with cmoposer? Thanks

Contributor

jfxninja commented May 9, 2017

Happy to help! Any idea when this will be available in a tag so I can include with cmoposer? Thanks

@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik May 9, 2017

Member

Yes, I'm working on a release! )

Member

DavertMik commented May 9, 2017

Yes, I'm working on a release! )

chris1312 added a commit to chris1312/Codeception that referenced this pull request Jun 16, 2017

Safe prefix aliases for buildAssociationQuery() (#4195)
Consider the following

   $I->seeInRepository(
        'OrderItem',
        array(
            'order' => array(
                'recipient_email'=> self::MEMBER_EMAIL
            )
        )
    );
Generates the following query:
SELECT s FROM OrderItem s INNER JOIN s.order order WHERE order.recipient_email = :order__recipient_email

Currently fails with expected literal.

The suggested change would produce
SELECT s FROM OrderItem s INNER JOIN s.order _order WHERE _order.recipient_email = :_order__recipient_email
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment