netgen / NetgenInformationCollectionBundle

Information collection alike feature for eZ Publish 5/eZ Platform
https://netgen.io
GNU General Public License v2.0
19 stars 8 forks source link

Hyphens in parameter placeholder names break the query on Mysql 8 #75

Closed hknezevic closed 2 years ago

hknezevic commented 2 years ago

For example:

public function findByCollectionId($collectionId)
{
    $qb = $this->createQueryBuilder('eica');

    return $qb->select('eica')
        ->where('eica.informationCollectionId = :collection-id')
        ->setParameter('collection-id', $collectionId)
        ->getQuery()
        ->getResult();
}

throws a following error:

[Semantical Error] line 0, col 146 near 'id': Error: 'id' is not defined.

This was first noticed in setup using Mysql 8 with default configuration, PHP, Symfony and Doctrine versions match some of the previous projects where the issue was not occuring. The only difference is Mysql 8 being used instead of Mysql 5.7

Course of action: replace all placeholder names in all of the queries with camel case format

Error present in both 1.x and master/2.x versions

hknezevic commented 2 years ago

Thank you @leohajder !