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

Phalcon 3 validation bug?

Hello.

I am trying to build a validation, for my users model.

When I insert into the model, i have Password as required, not as a validation, but just in the SQL not null.

That's works fine.

I then added a password StringLength

BUT

When I try to update a user's firstname and lastname, it says that the password length is over the max, however, i am not even trying to update the password? But when ever i try to update the model, then it says the password is not long enough, but i dont need to update the password??

Am I missing something?

edited Feb '17

I guess you have password as hash? And that hash excess password length? Just add hasChanged(and keepSnapsots in initialize method) check for password in validation method, only if it was changed add stringlength validator and move hashing to afterValidation method. It's for sure not bug, im using strinlength myself and no problems there.

Also remember to change model password value only if user provided something, like not empty value.

Like i said, i am not even trying to change password. It's not part of the form. yet it still requires it to be filled.

Idk, without code we can't do anything. Maybe it's not null validation?