propelorm / Propel2

Propel2 is an open-source high-performance Object-Relational Mapping (ORM) for modern PHP
http://propelorm.org/
MIT License
1.26k stars 399 forks source link

FIX failing queries on datetime fields set to 1970-01-01 00:00:00 via (int) 0 #2011

Open hsegnitz opened 4 months ago

hsegnitz commented 4 months ago

The Problem was the not-type-safe null-check in the PropelDateTime util class. Passing an Integer 0 (that e.g. comes from the SplFileInfo::getMtime()) to the setter of the field, results in the 0 being interpreted as null, thus the update/insert query is failing.

FIxes #2010

hsegnitz commented 4 months ago

Hmmm... I'm afraid I might need some help with the failing CI tests, to me that looks unrelated to my change and more like some init failure?