We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

[2.0.0] Phalcon\Validation\Validator\PresenceOf fails on 0

Since Version 2.0.0 the Phalcon\Validation\Validator\PresenceOf Validator returns failure if the Value is "0".

$validator->add('activities', new PresenceOfValidator());

I have an Input field where the Customer writes the Number of Activities for an Entity. It is possible to have 0 activities for the Entity.

With Version 1.3.4 everything works fine. But since Version 2.0.0 the validator fails if i enter 0 activities.

Seems for me like it's a bug

Could you please report this on Github as a bug?