Details
Description
First of all when creating an event from a template, the created_date parameter is being used from the template. Although that might not be a major issue (or maybe even desired), the bigger issue is that the event cannot be created...results in error:
Database Error Code: Incorrect datetime value: '2011' for column 'created_date' at row 1, 1292
I tracked down where the date is being stripped to just the year in package/DB/DataObject.php line 1040 > $rightq .= ' ' . intval($this->$k) . ' ';
The issue is that the created_date is being passed in as a formatted date field (e.g. 2011-1-1 10:00:00) which is then changed to 2011 by the intval function. When creating a new event without the template the date is passed in as date('YmdHis') e.g. 201111100000.
The solution I came up with is to ignored the check for an empty created_date field in the create function of Event/BAO/Event.php (line 143). Unless I am missing something, the check for the id parameter should be enough to determine if the created_date field should be set to the current date (i.e. creating a new event).