10 May 2010 at 3:27am
Google Summer of Code Hacker,
In my model I've defined: 'Title' => 'Varchar(32)',
In the ModelAdmin I can enter any number of characters and successfully save the object - if I've entered more than 32 characters in the title they are also displayed after saving.
If I reload the object, the title it is cut off after 32 characters (as the database simply doesn't store more than this). I would have expected / hoped for some kind of warning when trying to save more than the possible characters - currently they are lost without any kind of message.
Is this a bug, am I doing something wrong or how can this be fixed?
10 May 2010 at 10:44pm
I'm not sure ModelAdmin (or any of the CMS form fields) provide this sort of automatic validation for lengths of data. You can set the max length of the TextField (eg 32) in the constructor but don't think a nice error message will be generated (just won't allow any more characters) the form valldation is one of the areas on the todo list.