[ihris-developers] Date bug/changes
Luke Duncan
lduncan at intrahealth.org
Wed Feb 13 10:14:58 EST 2008
The problem with saving dates is that MDB2 didn't understand 'datetime'
for a type in the array in the prepare statement. It wasn't showing up
as an error because the pearError check was looking at $res instead of
$result.
To fix it I just changed the field_type_db for DB_DATE to 'timestamp'
which is what MDB2 uses for 'YYYY-MM-DD HH:MM:SS'. I'm not sure if this
will cause issues with any other code so should I make a new field
called field_type_mdb2 to handle this and have it be the same for all
field types except dates?
There was also an error when checking dates against the current value in
the database. I modified form fields to have an isSameValue method to
do the check and over rode it for DB_DATE so it creates a date object to
do the necessary checking.
I noticed that the form fields all had field_type_report_db but I didn't
see that defined in I2CE_FormField and didn't see what was referencing
it. But maybe I just missed it. I assume it's just being used in the
report module but I didn't see any methods using it and I'm surprised it
works when the variable isn't defined in the parent class.
I'll wait to post up the changes until we go over whether I broke
anything else with the change to timestamp. We can chat on IRC about
it.
Luke
More information about the ihris-developers
mailing list