doctrine / orm

Doctrine Object Relational Mapper (ORM)
https://www.doctrine-project.org/projects/orm.html
MIT License
9.86k stars 2.5k forks source link

A boolean false breaks querybuilder update #11487

Closed that-guy-iain closed 3 weeks ago

that-guy-iain commented 3 weeks ago

Bug Report

Q A
BC Break no
Version 2.19.5

Summary

When you use false boolean value in the set of the querybuilder it doesn't work as expected.

$queryBuilder = $this->entityRepository->createQueryBuilder('t');
$queryBuilder->update(TaxType::class, 't')->set('t.default', false);
$queryBuilder->getQuery()->execute();

Current behavior

It causes the following error message

Warning: Attempt to read property "type" on null in vendor/doctrine/orm/src/Query/Parser.php line 2928

but it works if you put in 'false'

How to reproduce

Create an entity with a boolean value and then try to set it using the query builder with a boolean false.

Expected behavior

For it to know that false is a boolean value and value for the boolean value or to return an Syntax error instead of trying to access full.

greg0ire commented 3 weeks ago

Fixed, thanks!