jackalope / jackalope-doctrine-dbal

Doctrine DBAL transport implementation for Jackalope
http://jackalope.github.io
Other
143 stars 60 forks source link

prevent type error on Postgresql #375

Closed RobertMe closed 3 years ago

RobertMe commented 3 years ago

Prevent a cast error on Postgresql when no target is found for the given path. This by adding an early return of an empty array. MySQL and possibly other databases would cast the false value to 0, after which the query result would still be an enpty array as no node can have a target_id equaling 0.

RobertMe commented 3 years ago

I've run into this error when using Sulu CMS running on a Postgresql database. I think this is the correct fix, although I didn't dig into it too much. At least I found it odd that the query is run when there is no targetId, so I believe this early return with an empty array would be correct.

dbu commented 3 years ago

https://github.com/jackalope/jackalope-doctrine-dbal/releases/tag/1.5.1