The following error warning was appearing in the apache error log everytime a user viewed the calendar in month view:
[Fri Jun 01 14:30:37 2007] [error] [client 127.0.0.1] PHP Warning: date() [<a href='function.date'>function.date</a>]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in C:\\Program Files\\sugarcrm\\htdocs\\sugarcrm\\modules\\Calend ar\\templates\\templates_calendar.php on line 777, referer: http://localhost:8881/sugarcrm/index.php?module=Calendar&action=index
-This was happening in Version 4.5.1d
-running on both Windows XP and Windows Server 2003 (XP is a test version running on my local machine and the Windows Server 2003 is the production version that we actually use.)
-Running Apache 2.0.59
-Running PHP Version 4.4.3
-Running MySQL version 5.1.11
I was able to stop this from happening by changing line 773 of \modules\Calendar\templates\templates_calendar.php from:
$user_today_timestamp = mktime($matches[4], $matches[5], '0', $matches[2], $matches[3], $matches[1]);
to:
if(sizeof($matches)>=6)
$user_today_timestamp = mktime($matches[4], $matches[5], '0', $matches[2], $matches[3], $matches[1]);
else
$user_today_timestamp=mktime();
I believe this works because the $matches variable is getting set to an empty string which then causes an error when the date function is called. This fix actually improved the performance of the month view calendar in that after I applied it, the calendar now shows up with the current day boxed off whereas before that was not the case.
Any input on why this was happening in the first place would be appreciated.
Thanks,
Ben


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks