Issue Bug Closed

#81056Query Builder fails on greater / less comparisons on string fields

Matthias Krappitz 04/28/17, 10:36 updated 10/02/18, 10:59

Description

I upgraded a TYPO3 7.6.18 system to 8.7.1 and now in an extbase repository class in a custom finder method if i do this, i get results:

$query = $this->createQuery();
$result = $query
    ->matching(
        $query->like('quote', '%It was a pleasure%')
    )
    ->execute();

Whereas if i do this, i get no results:

$query = $this->createQuery();
$result = $query
    ->matching(
        $query->greaterThan('quote', '')
    )
    ->execute();

Even though there obviously do exist records with field “quote” being non empty as proven by the first query. With TYPO3 CMS 7.6.18 the $query->greaterThan(‘quote’, ‘’) comparison worked fine on the same data / system, returnin results. I guess there is internal problem in v8 with forming this query / comparison in the doctrine query builder.

Reviews 2