Page MenuHomePhabricator

MediaWiki\Title\Title::getPageViewLanguage was deprecated in MediaWiki 1.42
Open, Needs TriagePublicBUG REPORT

Description

MW 1.43, Metrolook 7.0.0.

Deprecated: Use of MediaWiki\Title\Title::getPageViewLanguage was deprecated in MediaWiki 1.42. [Called from MetrolookTemplate::execute in /var/www/wiki/w/skins/Metrolook/MetrolookTemplate.php at line 173] in /var/www/wiki/w/includes/debug/MWDebug.php on line 385

Call Stack
#	Time	Memory	Function	Location
1	0.0004	505064	{main}( )	.../index.php:0
2	0.0770	4326480	MediaWiki\MediaWikiEntryPoint->run( )	.../index.php:58
3	0.0770	4326480	MediaWiki\Actions\ActionEntryPoint->execute( )	.../MediaWikiEntryPoint.php:200
4	0.5812	11711408	MediaWiki\Output\OutputPage->output( $return = TRUE )	.../ActionEntryPoint.php:163
5	1.3468	12297616	Skin->outputPageFinal( $out = class MediaWiki\Output\OutputPage { (variables skipped) )	.../OutputPage.php:3193
6	1.3468	12314128	SkinTemplate->outputPage( )	.../Skin.php:683
7	1.3497	12323104	SkinTemplate->generateHTML( )	.../SkinTemplate.php:180
8	2.1735	14751080	MetrolookTemplate->execute( )	.../SkinTemplate.php:161
9	2.1775	14752896	MediaWiki\Title\Title->getPageViewLanguage( )	.../MetrolookTemplate.php:173
10	2.1775	14752896	wfDeprecated( $function = 'MediaWiki\\Title\\Title::getPageViewLanguage', $version = '1.42', $component = ???, $callerOffset = ??? )	.../Title.php:3613
11	2.1775	14752896	MediaWiki\Debug\MWDebug::deprecated( $function = 'MediaWiki\\Title\\Title::getPageViewLanguage', $version = '1.42', $component = FALSE, $callerOffset = 3 )	.../GlobalFunctions.php:773
12	2.1775	14753008	MediaWiki\Debug\MWDebug::deprecatedMsg( $msg = 'Use of MediaWiki\\Title\\Title::getPageViewLanguage was deprecated in MediaWiki 1.42.', $version = '1.42', $component = 'MediaWiki', $callerOffset = 4 )	.../MWDebug.php:237
13	2.1775	14754544	MediaWiki\Debug\MWDebug::sendRawDeprecated( $msg = 'Use of MediaWiki\\Title\\Title::getPageViewLanguage was deprecated in MediaWiki 1.42. [Called from MetrolookTemplate::execute in /var/www/wiki/w/skins/Metrolook/MetrolookTemplate.php at line 173]', $sendToLog = TRUE, $callerFunc = 'MetrolookTemplate::execute' )	.../MWDebug.php:355
14	2.1775	14754544	trigger_error( $message = 'Use of MediaWiki\\Title\\Title::getPageViewLanguage was deprecated in MediaWiki 1.42. [Called from MetrolookTemplate::execute in /var/www/wiki/w/skins/Metrolook/MetrolookTemplate.php at line 173]', $error_level = 16384 )	.../MWDebug.php:385

Event Timeline

Aklapper renamed this task from Deprecation im MW 1.42 to MediaWiki\Title\Title::getPageViewLanguage was deprecated in MediaWiki 1.42.Oct 4 2025, 9:56 AM

Hey I have tried to fix the bug coming on the page MetroLookTemplate.php , "Replaced deprecated Title::getPageViewLanguage with OutputPage::getLanguage() fallback in MetrolookTemplate" you can check it and review the code or if any issue or the changes is wrong let me know !

@Adarsh2406: Hi and welcome! Please follow https://www.mediawiki.org/wiki/Gerrit/Commit_message_guidelines and edit the commit message of your Gerrit patch so it will automatically be linked to this task. Thanks in advance.

@Aklapper thanks for letting me know this but i have already done this while commiting the changes in Gerrit !

@Adarsh2406: No you have not. If the commit message was correct, then there would be an automated notification in this very task.

okk okk @Aklapper i will check this in the link you provided and will let you know !

@Adarsh2406 Thanks! Please do not let me know - if it works there will be an automated message in this task anyway. :)

Hey I have tried to fix the bug coming on the page MetroLookTemplate.php , "Replaced deprecated Title::getPageViewLanguage with OutputPage::getLanguage() fallback in MetrolookTemplate" you can check it and review the code or if any issue or the changes is wrong let me know !

Please, add Bug: T406407 in the end of the commit message, so that I could see the URL of the patch and test it.

Change #1193533 had a related patch set uploaded (by Adarsh2406; author: Adarsh2406):

[mediawiki/skins/Metrolook@master] Metrolook: Use OutputPage::getLanguage() to avoid deprecated Title::getPageViewLanguage\n\nReplace the direct call to Title::getPageViewLanguage() in MetrolookTemplate::execute with OutputPage::getLanguage() when available, falling back to Title::getPageLanguage() as a safe legacy option. This removes the deprecation warning on MediaWiki 1.42+ while preserving behavior for older contexts.\n\nBug: T42\nBug: T406407\nChange-Id: I5db2ef3c6ba6046fa493387891c667f82575a4aa

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

Change #1193534 had a related patch set uploaded (by Adarsh2406; author: Adarsh2406):

[mediawiki/skins/Metrolook@master] Metrolook: Use OutputPage::getLanguage() to avoid deprecated Title::getPageViewLanguage\n\nReplace the direct call to Title::getPageViewLanguage() in MetrolookTemplate::execute with OutputPage::getLanguage() when available, falling back to Title::getPageLanguage() as a safe legacy option. This removes the deprecation warning on MediaWiki 1.42+ while preserving behavior for older contexts.\n\nBug: T42\nBug: T406407\nChange-Id: I5db2ef3c6ba6046fa493387891c667f82575a4aa

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

Change #1193536 had a related patch set uploaded (by Adarsh2406; author: Adarsh2406):

[mediawiki/skins/Metrolook@master] Metrolook: Use OutputPage::getLanguage() to avoid deprecated Title::getPageViewLanguage\n\nReplace the direct call to Title::getPageViewLanguage() in MetrolookTemplate::execute with OutputPage::getLanguage() when available, falling back to Title::getPageLanguage() as a safe legacy option. This removes the deprecation warning on MediaWiki 1.42+ while preserving behavior for older contexts.\n\nBug: T406407\nChange-Id: I5db2ef3c6ba6046fa493387891c667f82575a4aa

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

Change #1193534 abandoned by Aklapper:

[mediawiki/skins/Metrolook@master] Metrolook: Use OutputPage::getLanguage() to avoid deprecated Title::getPageViewLanguage\n\nReplace the direct call to Title::getPageViewLanguage() in MetrolookTemplate::execute with OutputPage::getLanguage() when available, falling back to Title::getPageLanguage() as a safe legacy option. This removes the deprecation warning on MediaWiki 1.42+ while preserving behavior for older contexts.\n\nBug: T42\nBug: T406407\nChange-Id: I5db2ef3c6ba6046fa493387891c667f82575a4aa

Reason:

Duplicate of https://gerrit.wikimedia.org/r/c/mediawiki/skins/Metrolook/+/1193526

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

Change #1193533 abandoned by Aklapper:

[mediawiki/skins/Metrolook@master] Metrolook: Use OutputPage::getLanguage() to avoid deprecated Title::getPageViewLanguage\n\nReplace the direct call to Title::getPageViewLanguage() in MetrolookTemplate::execute with OutputPage::getLanguage() when available, falling back to Title::getPageLanguage() as a safe legacy option. This removes the deprecation warning on MediaWiki 1.42+ while preserving behavior for older contexts.\n\nBug: T42\nBug: T406407\nChange-Id: I5db2ef3c6ba6046fa493387891c667f82575a4aa

Reason:

Duplicate of https://gerrit.wikimedia.org/r/c/mediawiki/skins/Metrolook/+/1193526

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

Change #1193536 abandoned by Aklapper:

[mediawiki/skins/Metrolook@master] Metrolook: Use OutputPage::getLanguage() to avoid deprecated Title::getPageViewLanguage\n\nReplace the direct call to Title::getPageViewLanguage() in MetrolookTemplate::execute with OutputPage::getLanguage() when available, falling back to Title::getPageLanguage() as a safe legacy option. This removes the deprecation warning on MediaWiki 1.42+ while preserving behavior for older contexts.\n\nBug: T406407\nChange-Id: I5db2ef3c6ba6046fa493387891c667f82575a4aa

Reason:

Duplicate of https://gerrit.wikimedia.org/r/c/mediawiki/skins/Metrolook/+/1193526

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

Change #1193526 had a related patch set uploaded (by Aklapper; author: Adarsh2406):

[mediawiki/skins/Metrolook@master] Replace deprecated Title::getPageViewLanguage with OutputPage::getLanguage() fallback in MetrolookTemplate

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

added bug -id
@alex-mashin

Thank you, it seems to help.

Hi — Verified +2 is green. Could someone with Code-Review/Submit rights please give Code-Review +2 and submit this change?
Also please backport to REL1_43 if accepted.
Bug: T406407. Thanks!

Can anyone please review my changes as its been a long time i pushed the changes and there is no code review ?

Can anyone please review my changes as its been a long time i pushed the changes and there is no code review ?

Looks like this change is no longer needed, because this bug has been fixed earlier by another patch; which is now backported to MW 1.43.

ok okk @alex-mashin then should i abandon this change on my gerrit ?

ok okk @alex-mashin then should i abandon this change on my gerrit ?

I think, yes.

Change #1193526 abandoned by Adarsh2406:

[mediawiki/skins/Metrolook@master] Replace deprecated Title::getPageViewLanguage with OutputPage::getLanguage() fallback in MetrolookTemplate

Reason:

The bug is alreadt fixed by someone !

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