valMinLen and ValManLen fail validation on null strings #1057

Closed
indrajitr opened this Issue Jun 28, 2011 · 3 comments

3 participants

@indrajitr
Lift Web Framework member

valMinLen and valMaxLen fail validation for objects with mapper string fields that are null. I ran into this problem when reading a User object that has valid null data in some MappedString fields. For example, I have a User object with a MappedString field called ZipCode (not a MappedPostalCode) that was null in the DB. When I tried to update another field on this user, say firstName for example, the null ZipCode failed validation. Here is the original thread on the lift discussion group that I added: http://groups.google.com/group/liftweb/browse_thread/thread/6c9dc59adca8c688/4e562d6584bf6eed

In that thread, David mentions he will modify these methods with a flag to leave the default behavior the same as to not break existing code. Thanks all.

@dpp
Lift Web Framework member
dpp commented Jul 7, 2011

I'm going to change valMaxLen to accept null Strings.

valMinLen is correct in rejecting null. A null String is a zero length string.

@dpp
Lift Web Framework member
dpp commented Jul 7, 2011

(In [[r:7cc7134c37a599dd7f80a646eb0ce49d1d318862]]) Closes #1057. valMaxLen accepts null entries

Branch: master

@dpp dpp was assigned Mar 1, 2012
@etorreborre etorreborre pushed a commit to etorreborre/framework that referenced this issue Dec 3, 2014
@dpp dpp Closes #1057. valMaxLen accepts null entries 7cc7134
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment