Page MenuHomePhabricator

clearInterwikiCache.php depends on $wgLocalDatabases, which is unexpected
Open, Needs TriagePublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

  • Update an interwiki on the interwiki table of the database
  • Run maintenance/clearInterwikiCache.php to clear the interwiki cache (otherwise the change is not visible on pages)

What happens?:

The script outputs nothing. The interwiki cache is not cleared.

What should have happened instead?:

The interwiki cache should have been cleared,

Looking at the source code, the script iterates through $wgLocalDatabases, which normally it's not set (defaults to an empty array). For each entry in $wgLocalDatabases it should print the wiki id. In my wiki this setting is untouched and hence empty.

It should have cleared the interwiki cache of the current wiki if $wgLocalDatabases is not set.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc:

MediaWiki 1.36

Event Timeline

The script outputs nothing. The interwiki cache is not cleared.

Thank you @Ciencia_Al_Poder. This is strange for me too. It seems the variable $wgLocalDatabases was designed to list local databases but, as default, $wgDBName is not considered one of them and I have no explanation for this.

I think Wikimedia Foundation and other big wikis do not have problems with the default value because they override it, like they do here:

$wgLocalDatabases = $wgConf->getLocalDatabases();

The empty default deserves more clarification. I've added a note here but I don't know who could help on this: