Fixed the data field handling
Posted by mholmes on 24 Jun 2009 in Activity log
I realized that I haven't been making a clear enough distinction in the MdhField descendants between the local field $val (which is a string, an integer, or whatever), the method getValAsStr() (which should return the contents of $val in a form which can be used in an SQL statement), and getValAsHtmlStr() (which renders the value in a form which is suitable for display in a table on a page etc.). That was at the heart of the error with the date field, where I was submitting the $val (which could be, say, "1700") instead of the getValAsStr() (which in that case would be "1700-00-00") to mySQL. mySQL needs all those digits for a date field.