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

Missing query-builder-expression leads to wrong SQL-query and false results #249

Open
h-e-l-l-o-w-o-r-l-d opened this issue Mar 1, 2022 · 0 comments

Comments

@h-e-l-l-o-w-o-r-l-d
Copy link

h-e-l-l-o-w-o-r-l-d commented Mar 1, 2022

Hi,

I spotted a wrong sql-query with a missing query-builder-expression here:

$queryBuilder->andWhere($key, $queryBuilder->createNamedParameter($value));

Current:

$queryBuilder->andWhere($key, $queryBuilder->createNamedParameter($value));

leads to SELECT crdate_year FROM pages WHERE (doktype) AND (:dcValue1) AND...

and results in

0
2017
2018
2019
2020
2021
2022

Wanted:

$queryBuilder->andWhere($queryBuilder->expr()->eq($key, $queryBuilder->createNamedParameter($value)));

leads to SELECT crdate_year FROM pages WHERE (doktype = :dcValue1) AND...

and results in

2019
2020
2021
2022

So it's just 1 line for fixing it. ;-)

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

Successfully merging a pull request may close this issue.

1 participant