Page MenuHomePhabricator

Provide default time zone selection in installer
Open, MediumPublicFeature

Description

While mediawiki's UTC default is good for massively international sites, many local or workgroup wikis would much prefer using local time as default. It may be good to provide an option at install time to make it easier to set up this way.


Version: 1.21.x
Severity: enhancement

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:42 PM
bzimport set Reference to bz19991.

mickewiki wrote:

Patch to add timezone selection at installation

I wanted to try and fixa a bug, and this seemed easy enough for me :) so here is a patch. I also requires the file includes/TimeZones.php which I will upload imidiatly after I'm done with the patch upload.

attachment bug19991.patch ignored as obsolete

mickewiki wrote:

Holds an array of valid timezone options

This file goes into includes directory and the earlier supplied patch depends on it

attachment TimeZones.php ignored as obsolete

Hmmm.... there shouldn't be any need to make our own timezone database; we've already got access to the system TZ database through the DateTime class and friends, as done in Special:Preferences.

mickewiki wrote:

Patch to add timezone selection at installation

Right, as it seems any value in DateTimeZone::listIdentifiers() is a valid option for $wgLocaltimezone I just went ahead and used that function instead, so there is no longer any need for the array of time zones.

I probably should mention that what this patch does is that it adds a section to LocalSettings.php per the primary instructions in http://www.mediawiki.org/wiki/Manual:Timezone. It only does this if it's not running in safe mode however (and if it is, the selection should be entirely invisible at installation).

/Micke

attachment bug19991.patch ignored as obsolete

svippy wrote:

Why not make a hideable section on the install page for "optional" or "non-important" settings. When unhid, these settings can be configured away from their default position (which obviously is presented), if they are changed, they will be added to the LocalSettings.php, otherwise they won't make it in there.

One of these settings could be the change timezones, but it could also be one that was "enable uploads" from before and stuff like that.

I realise this is more UI work over what can be changed easily later in the LocalSettings.php, but if we are going this way with this bug anyway, I do not see a reason not to go all in.

Should probably patch this against the new-installer branch. Don't really see a huge reason to keep putting new things in the installer that's going away.

Trying to lure Chad into taking this...

sumanah wrote:

(In reply to comment #6)

Should probably patch this against the new-installer branch. Don't really see a
huge reason to keep putting new things in the installer that's going away.

Micke Nordin, thank you for your patch. Do you have time and interest in revising it so it works with our current codebase?

Thanks!

mickewiki wrote:

I'll look into this agin and see if I can familiarize myself with the new installer.

mickewiki wrote:

I suppose it would make sense to put this in the optional section of the installer? I'll see if I can figure out how to do that :)

mickewiki wrote:

It seems to be the class WebInstaller_Options in includes/installer/WebInstallerPage.php that needs to be patched with a with a dropdown menu like the ones used in WebInstaller_Language.

mickewiki wrote:

A patch to add a timezone selector to the webinstaller

Ok, I think this should work. It does for me.

attachment fix_installer_with_timezone.patch ignored as obsolete

Hi Micke! Thanks for your reworked patch!
Could you merge your patch into one patch that can be applied to the codebase, instead of the current situation that your latest patch depends on your previous patch?

Furthermore, you are very welcome to use Developer access

https://www.mediawiki.org/wiki/Developer_access

to submit this as a Git branch directly into Gerrit:

https://www.mediawiki.org/wiki/Git/Tutorial

Putting your branch in Git makes it easier for us to review it quickly.
Thanks again! We appreciate your contribution.

mickewiki wrote:

Fix for bug 19991

A clean diff

Attached:

mickewiki wrote:

There is a new clean diff now, I'll look in to the git stuff as well to see if I can get a branch in gerrit.

mickewiki wrote:

Ok, I put it in gerrit now as well:

https://gerrit.wikimedia.org/r/47442

I hope I got everything right :)

Patch in Gerrit needs rework...

Change 47442 had a related patch set uploaded by Nemo bis:
Added a timezone selector to the webinstaller

https://gerrit.wikimedia.org/r/47442

Change 47442 had a related patch set uploaded (by Paladox):
Added a timezone selector to the webinstaller

https://gerrit.wikimedia.org/r/47442

Change 720475 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/core@master] Installer: Add $wgLocaltimezone to LocalSettings template

https://gerrit.wikimedia.org/r/720475

Change 720475 merged by jenkins-bot:

[mediawiki/core@master] Installer: Add $wgLocaltimezone to LocalSettings template

https://gerrit.wikimedia.org/r/720475

Krinkle subscribed.

Note that the above patch does not resolve the task, but it lays the groundwork for a possible selector in the installer.

Change 722905 had a related patch set uploaded (by Jforrester; author: Gergő Tisza):

[mediawiki/core@REL1_37] Installer: Add $wgLocaltimezone to LocalSettings template

https://gerrit.wikimedia.org/r/722905

Change 722905 merged by jenkins-bot:

[mediawiki/core@REL1_37] Installer: Add $wgLocaltimezone to LocalSettings template

https://gerrit.wikimedia.org/r/722905

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 12:24 PM