Topic on Project:Support desk

The sidebar automatically changes back to default on some wiki page

11
3Qvery (talkcontribs)

Hello, I am meeting trouble when I use mediawiki.

I have changed mediawiki:sidebar at first, and it worked well.

Then I edited LocalSettings.php , I changed the language.

$wgLanguageCode = "zh";

"zh" means Chinese, and it have many variant languages, such as Simplified Chinese, Traditional Chinese and so on. It can be changed at the top tab of webpage.

Then I found that, the sidebar of some of my wiki page changed back to default. But some wiki page still works well.

I found, if the wiki page have interwiki link (such as [[wikipedia:homepage]], [[en:homepage]]), the sidebar of this page will change back to default. Otherwise, the sidebar will be my custom configuration. Else, if I change the language back to "zh-hans-cn", it works well again.

So I want to ask how to solve this problem? I want to keep my language setting "zh", because I can turn it to simplified Chinese or traditional Chinese quickly, and I also want to change my sidebar.

Bawolff (talkcontribs)

If you purge the page, is the sidebar still wrong? (You can purge a page by adding either ?action=purge or &action=purge to the end of the url)

It sounds like something is weird with l10n cache. Maybe interwiki parsing somehow induces an error that breaks the localization system somehow. Maybe debug logging would have something interesting to say for such pages (When parsing them, like during an edit, not just during a view), I'm not sure.

3Qvery (talkcontribs)

Emm, I used the "?action=purge", but nothing happened. In fact, if I purge the cache of my browser, or change the browser, it is also nothing happened.

Else, if I removed the interwiki link from the wiki page, the sidebar will be correct.

Seemingly, if there are interwiki links in the template, the sidebar is also wrong.

3Qvery (talkcontribs)
  • Else, if there is a link like "[[:Category:xxx]]" in the page, the sidebar is wrong. But "[[Category:xxx]]",the sidebar is right.
  • In some namespaces, the sidebar is also wrong. For example, in "project" namespace, it is always wrong; in "special" namespace, it is always right, except special:preferences, it is wrong.
  • Else, if I edit page (the url includes "&action=edit" or "&action=submit"), it is always wrong.


My spacial:version

产品 版本
MediaWiki 1.33.1
PHP 7.3.11 (apache2handler)
MariaDB 10.4.8-MariaDB
AhmadF.Cheema (talkcontribs)
3Qvery (talkcontribs)

Whether $wgEnableSidebarCache is true or false, nothing happened. I guess it is not problem on cache. Whether removed the interwiki link (include the link to the category) or change $wgLanguageCode back to my default zh-hans-cn, the sidebar will be correct.

3Qvery (talkcontribs)

Well, if I change back $wgLanguageCode to zh-Hans-CN, sidebar will be right. But I can't use language variant selector. So how can I use language variant selector, except change $wgLanguageCode to zh, that will make sidebar become default. Or I can solve sidebar problems.

Bawolff (talkcontribs)

Well something seems very messed up with the l10n cache.

I'm out of ideas more or less, at this point I would suggest truncating the l10n_cache table (or l10n cache files if $wgCacheDirectory is set. If you have $wgCacheDirectory set up you can use rebuildLocalisationCache.php --force maintenance script). Also setting up mediawiki debug logging, and see if any errors or warnings are reported related to l10n cache.

3Qvery (talkcontribs)

I tried rebuildLocalisationCache.php --force , however, it seems nothing happened.

I also opened the debug, It showed me like this:

[SQLBagOStuff] SqlBagOStuff::lock failed due to timeout for mywiki:messages:zh-hans.
[MessageCache] MessageCache::load: Loading zh-hans... local cache is empty, global cache is expired/volatile, loading from database
[SQLBagOStuff] SqlBagOStuff::lock failed due to timeout for mywiki:messages:en.
[MessageCache] MessageCache::load: Loading en... local cache is empty, global cache is expired/volatile, loading from database
[SQLBagOStuff] SqlBagOStuff::lock failed due to timeout for mywiki:messages:zh-hant.
[MessageCache] MessageCache::load: Loading zh-hant... local cache is empty, global cache is expired/volatile, loading from database
......

Else, I found that except sidebar, all system messages all may showed back as default, or all "MediaWiki" namespace showed as default, except MediaWiki:Common.css and MediaWiki:Common.js.

Else, I tried to set $wgLanguageConverterCacheType. If I use CACHE_ANYTHING or CACHE_DB, it showed like now, some pages are correct, some paged are wrong. If I use CACHE_NONE, all of the pages are wrong, showed as default.

If I use the language without language converter, some pages will show a lot of like-{}-, affect appearance.

Thanks for help!

3Qvery (talkcontribs)

I found that, if I use language variant selector, my sidebar will be wrong like this. While I tried other languages like gan, kk(Kazakh) and so on. So now I want to keep my sidebar, I have to abandon language variant selector.

This post was hidden by 3Qvery (history)
Reply to "The sidebar automatically changes back to default on some wiki page"