Running the xmlrpc tests, I get 29 of the mostly-same exceptions:

date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead Run-time notice xmlrpc.inc 384-390 xmlrpc_date() - 28 exceptions

mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead Run-time notice xmlrpc_test.module 33 xmlrpc_test_manyTypesTest() - 1 exception

From the PHP manual (http://us2.php.net/date):

Every call to a date/time function will generate a E_NOTICE if the time zone is not valid, and/or a E_STRICT message if using the system settings or the TZ environment variable. See also date_default_timezone_set()

I know Drupal has it's own way of handling timezones, but is there a way to pass that info to date_default_timezone_set() so we don't get these test exceptions? Should we be using Drupal's existing format_date?

Using PHP 5.2.4-2ubuntu5.3. The following is the 'date' section of my phpinfo():

date/time support 	enabled
"Olson" Timezone Database Version 	2007.6
Timezone Database 	internal
Default timezone 	America/Chicago

Comments

dave reid’s picture

Component: base system » tests
dave reid’s picture

Status: Active » Needs review
StatusFileSize
new1.26 KB

Patch changes the date() calls to durpal_format_date() and fixes 28 of 29 exceptions. Trying to figure out how to fix the mktime call...

damien tournoud’s picture

@Dave: you should simply use gmmktime

damien tournoud’s picture

... and gmdate()... if you really want to use format_date, please also add a sane $langcode parameter.

dave reid’s picture

Assigned: Unassigned » dave reid
StatusFileSize
new2.07 KB

Thanks Damien for pointing me in the better direction. Attached patch now passes 100% for xmlrpc with no exceptions. I like seeing green. Needs a little review.

damien tournoud’s picture

Status: Needs review » Reviewed & tested by the community

I can confirm I also get these exceptions when running in E_ALL | E_STRICT mode. The patch remove those exceptions, it's logic is sound. Thanks, Dave.

damien tournoud’s picture

Priority: Minor » Normal

Oh, and this is a true bug in the XML-RPC implementation, that should be backported all the way down to D5.

dries’s picture

Status: Reviewed & tested by the community » Fixed

I've committed this patch to CVS HEAD, and backported the xmlrpc.inc part to DRUPAL-6. All committed. Thanks!

damien tournoud’s picture

Version: 7.x-dev » 5.x-dev
Status: Fixed » Patch (to be ported)

To be ported to D5.

marcingy’s picture

Component: tests » ajax system
Status: Patch (to be ported) » Closed (won't fix)

Marking as won't fix as d5 is end of life.