Last modified: 2014-09-24 00:08:12 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T26308, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 24308 - Preferences screen fails on unspecified timezone
Preferences screen fails on unspecified timezone
Status: NEW
Product: MediaWiki
Classification: Unclassified
User preferences (Other open bugs)
1.15.x
PC Windows Server 2003
: Low major (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-08 08:36 UTC by Ed
Modified: 2014-09-24 00:08 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Ed 2010-07-08 08:36:43 UTC
It would appear that the PHP date_create() function fails (freezes) when the timezone isn't specified. To fix this problem, I modified Includes/Specials/SpecialPreferences.php, around line 1052, as follows:

Before:
    $now = date_create( 'now );

After ($wgLocaltimezone is specified in LocalSettings.php):
    global $wgLocaltimezone;
    $now = date_create( 'now', $wgLocaltimezone );

This happened on my system, running Windows Server 2003, MediaWiki 1.15.4, PHP 5.3.0 (apache2handler), MySQL 5.1.35-community.
Comment 1 Ed 2010-07-08 08:43:35 UTC
... the "Before" is really this: $now = date_create( 'now' );
Comment 2 Sam Reed (reedy) 2010-07-09 06:30:22 UTC
Code is at 1197 of includes/Preferences.php now (in trunk), and also in 1.16

http://www.php.net/manual/en/datetime.construct.php

"If $timezone is omitted, the current timezone will be used."

Seems to work fine on my trunk install.. PHP windows bug?
Comment 3 Ed 2010-07-11 16:57:09 UTC
That is what I would suspect, which is why I made it quite clear exactly what my configuration was. It works ok on Windows XP and Linux Ubuntu, but not on Windows Server 2003. I guess I should have mentioned where it DID work too...

Anyway, it seems to work now, with my patch, in Windows Server 2003. Thanks for putting the fix in the main version.
Comment 4 Ed 2010-07-12 10:29:22 UTC
I put the fix in 1.16.0beta3, Preferences.php, around line 1193, and it fixes the problem. I was testing with Windows Server 2003, PHP 5.3.0 (apache2handler), MySQL 5.1.35-community.
Comment 5 Sumana Harihareswara 2011-07-08 19:17:05 UTC
Ed, can you test with an installation of MediaWiki 1.17.0 and see whether the issue still happens (that is, without your patch)?  And if the issue still happens, and your patch fixes it, could you attach it *as a patch*?

Thanks!

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links