Page MenuHomePhabricator

losing system messages when switching $wgLanguageCode = "en-gb" from $wgLanguageCode = "en";
Closed, DeclinedPublic

Description

Author: buzz

Description:
My site was set to $wgLanguageCode = "en" and I have a few customised system messages (edited from the wiki). My user is actually set to en-gb and I can still see the customisations fine. On the system messages page, when choosing language "en" and searching for "modified" messages, my modifications show up.

However, when I switch $wgLanguageCode = "en-gb", the behaviour changes. I lose all my custom system messages. Doing a search from the System Messages special page for langauge "en" and searching for modified messages shows "no" messages. Doing a search for language "en-gb" and modified messages shows the same messages that I have changed, but it does not show my changes/customisations - it shows an exact copy of the "default" message.

This behaviour does not seem right at all.


Version: 1.16.x
Severity: major

Details

Reference
bz21591

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 10:49 PM
bzimport set Reference to bz21591.

buzz wrote:

In an attempt to clarify this issue, here are the steps to reproduce.

  1. install SVN version of mediawiki. LocalSettings will contain $wgLanguageCode = "en";
  2. edit MediaWiki:Common.css and add something like "body { background-color: #ddd}";
  3. refresh and see the background changes.
  4. change user preferences to en-GB and refresh. still can see common.css changes.
  5. go to Special:AllMessages and search for Modified messages for language en. common.css shows up with our customisations.
  6. edit LocalSettings.php and change $wgLanguageCode = "en" to $wgLanguageCode = "en-gb"
  7. refresh and MediaWiki:Common.css changes are not showing.
  8. search for modified messages for language en. No results.
  9. search for modified messages for language en-GB. one result - common.css however, it shows the contents of the "modification" as identical to the default value.

Original /* CSS placed here will be applied to all skins */
Modified : /* CSS placed here will be applied to all skins */

this bug is causing me big problems trying to change the default language. I'm upgrading it to major. downgrade if you disagree, but I hope someone can give me some feedback on this.

Can someone please check if it happens on 1.15?

buzz wrote:

I have just checked. behaviour is different on 1.15.1

  1. refresh and MediaWiki:Common.css changes are not showing.
  2. on 1.15 they are showing
  1. search for modified messages for language en-GB. one result - common.css

however, it shows the contents of the "modification" as identical to the
default value.

  • on 1.15 you can search for modified messages and the common.css shows up with the changes

Just clear the message cache, or wait for it to expire. The issue occurs because when $wgLanguageCode is en, the en-gb message cache stores only the en-gb customisations, and there aren't any so it's an empty array. When you change $wgLanguageCode to en-gb, the cache key is now meant to have all the default customisations, without any slash in the title, but it still has the empty array cached from before.

If you're using CACHE_DB, run the SQL query:

sql> TRUNCATE TABLE objectcache;

If you're using CACHE_MEMCACHED:

$ /etc/init.d/memcached restart

Alternatively, delete the problematic cache key:

$ cd /path/to/wiki/maintenance
$ php eval.php
> $wgMemc->delete( "$wgDBname:messages:en-gb" );

buzz wrote:

Thanks. This has solved it for me.