Fix/validates length of min max length

https://www.openproject.org/work_packages/14632
I'd love to see some documentation for this method. So that we know what this method intends to do.