symfony/symfony — Issue #3161: 'NaN' string is mapped to a decimal field as a float(NaN)
Author: zerkms
Created: 2012-01-20 03:17:35+00:00
State: open

I followed the tutorial at http://symfony.com/doc/current/book/doctrine.html and after that generated CRUD.

The `price` member looks like:

/**
* @var decimal $price
*
* @ORM\Column(name="price", type="decimal", nullable=false)
*/
private $price;

If we specify `NaN` as a price form value - form is treated as **valid** and we get a warning from logger

Warning: [json] (php_json_encode) double NAN does not conform to the JSON spec, encoded as 0 in /var/www/sf/vendor/symfony/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php line 44

I think that string `NaN` should be treated as invalid decimal value thus form should be treated as invalid