| Q | A
|------------ | ------
| BC Break | yes
| Version | 2.6.0
Query Builder Expressions are not behaving the same as before. We're trying to get all entities before a certain date using
$qb = $this->createQueryBuilder('site');
$query = $qb
->select('site')
->where($qb->expr()->lte('site.endDate', (new \DateTime())->format('Y-m-d')))
->getQuery();
Instead of comparing dates, the query builder seems to think, that it's a calculation which leads to very different results.
SELECT * FROM site WHERE endDate <= '2018-05-24';
SELECT * FROM site WHERE endDate <= 2018 - 05 - 24;
See code snippet above
@rmbl what are the exact generated DQL strings before/after, and is it 2.6.0 exactly that broke this?
We're currently using 2.6.1. I'll try it with all relevant versions later. Our customers only noticed the GDPR yesterday (or so it seems).
Our customers only noticed the GDPR yesterday (or so it seems).
I was unable to find a working version. Seems like that was always the behaviour and the previous developer was using the function wrong. No idea how that function ever worked.
Most helpful comment
https://youtu.be/G1WomfhjyVM?t=29