Page MenuHomePhabricator

Messages don't get localized in the updater
Closed, ResolvedPublic

Description

Running with an out-of-date MySQL version in MW 1.39 emits:

MediaWiki 1.39.0-alpha Updater

Your composer.lock file is up to date with current dependencies!
⧼config-mysql-old⧽

Note that the helpful status message which tells you what version of MySql/MariaDB you *should* be running is omitted.

What is expected is something like:

MediaWiki 1.39.0-alpha Updater

Your composer.lock file is up to date with current dependencies!
MySQL 16.99.0 or later is required. You have 10.5.15-MariaDB-0+deb11u1.

(You can test this by changing $minimumVersion in includes/installer/MysqlInstaller.php to something ridiculously high.

The root cause seem to be the fact that $wgMessagesDirs is updated to point to the error messages used by the installer/updater (T206765: config-mysql-old not being substituted by update.php) but the LocalisationCache gets passed the value of $wgMessagesDirs in its ServiceOptions. Thus we need to reset the LocalisationCache (as well as the LanguageFactory, which holds a reference to the LocalisationCache) in order to get it to pick up the new value of $wgMessagesDirs.

Event Timeline

Change 804617 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/core@master] update.php: Ensure that error messages are properly localized

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

Change 950086 had a related patch set uploaded (by Brian Wolff; author: Brian Wolff):

[mediawiki/core@master] Ensure that installer i18n is loaded by update.php

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

Change 804617 abandoned by C. Scott Ananian:

[mediawiki/core@master] update.php: Ensure that error messages are properly localized

Reason:

Abandoned in favor of Id1ff61b4c2fb1b5dd9e86ce5693e0126f2121c89

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

cscott claimed this task.

Change 950086 merged by jenkins-bot:

[mediawiki/core@master] Ensure that installer i18n is loaded by update.php

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

Change 959859 had a related patch set uploaded (by Brian Wolff; author: Brian Wolff):

[mediawiki/core@REL1_40] Ensure that installer i18n is loaded by update.php

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

Change 959860 had a related patch set uploaded (by Brian Wolff; author: Brian Wolff):

[mediawiki/core@REL1_39] Ensure that installer i18n is loaded by update.php

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

Change 959859 merged by jenkins-bot:

[mediawiki/core@REL1_40] Ensure that installer i18n is loaded by update.php

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

Change 959860 merged by jenkins-bot:

[mediawiki/core@REL1_39] Ensure that installer i18n is loaded by update.php

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