Fix not-loaded DbPageLanguage when Title::getPageLanguage() get's called
authorFlorian <florian.schmidt.stargatewissen@gmail.com>
Sat, 19 Dec 2015 15:25:45 +0000 (16:25 +0100)
committerUmherirrender <umherirrender_de.wp@web.de>
Tue, 16 Feb 2016 20:37:40 +0000 (20:37 +0000)
commitd23738002136761e34f11d72e7dd7eea65e3b655
tree83f2393d412ac7fdbde572d5ed361c60f62cda90
parentd8e2b6751606473468b1ba8ecd699be4914561a8
Fix not-loaded DbPageLanguage when Title::getPageLanguage() get's called

If the Title object isn't the title of the current viewed WikiPage, the page_lang
field of the database isn't requested. This results in the problem, that
Title::getPageLanguage() always returns the default content language, even if
the page language is different (changed with Special:PageLanguage, if
wgPageLanguageUseDB is true). That is problematic for the Translate extension,
which relies on the correct page language.

This change makes sure, that getPageLanguage() always return the correct page
language. If the page language isn't loaded already, Title::getPageLanguage()
now does a database lookup (if $wgPageLanguageUseDB is true) to get the correct
page language. It will use LinkCache for the page_lang field.

Bug: T121666
Change-Id: I0ae5ea39f7a124ed427ca5dfb26c1a116b27a94e
includes/OutputPage.php
includes/Title.php
includes/api/ApiPageSet.php
includes/cache/LinkBatch.php
includes/cache/LinkCache.php
includes/parser/LinkHolderArray.php
includes/specials/SpecialPageLanguage.php