Page MenuHomePhabricator

Deprecate and remove mw.config wgMainPageTitle
Closed, ResolvedPublic

Description

Originally added in 2009 with cf75bdf4ba (r54384) and moved to the startup module in 2010 with a99f9ec28b9aa9d (r72772).

Only very rarely used. Easily migrated in favour of:

Detect main page

Instead of using wgMainPageTitle to compare with wgTitle or wgPagename, use wgIsMainPage instead.

Linking to the main page

For creating an anchor link that will end up on the main page, use wgScript, or title=. It will always resolve to the main page by default.

Getting the main page configuration value

When the configuration value from the current site is really needed. It can be retrieved in one of two ways:

  • For gadgets, use the Siteinfo API.
  • For extensions, use Title::newMainPage() and bundle its return value with the module that needs it.

Event Timeline

Change 503551 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/ContentTranslation@master] mw.cx.ui.Header: Bundle wgMainPageTitle with the module

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

mwgrep (30 results)
bgwikinews          MediaWiki:Common.js
bnwikisource        MediaWiki:Gadget-Site.js
dewikiquote         MediaWiki:Common.js
dewikiversity       MediaWiki:ImageAnnotatorConfig.js
enwiki              MediaWiki:ImageAnnotatorConfig.js
enwikisource        MediaWiki:Gadget-Site.js
eowiki              MediaWiki:ImageAnnotatorConfig.js
fawiki              MediaWiki:ImageAnnotatorConfig.js
huwiki              MediaWiki:Common.js
huwiki              MediaWiki:Gadget-warning.js
kawiki              MediaWiki:ImageAnnotatorConfig.js
kowikisource        MediaWiki:Gadget-Site.js
mediawikiwiki       MediaWiki:Gadget-site.js
mlwiki              MediaWiki:ImageAnnotatorConfig.js
mlwikibooks         MediaWiki:Common.js
orwiki              MediaWiki:ImageAnnotatorConfig.js
plwiki              MediaWiki:Gadget-heading-icons.js
plwikivoyage        MediaWiki:Gadget-heading-icons.js
pnbwiki             MediaWiki:ImageAnnotatorConfig.js
ruewiki             MediaWiki:Common.js
sewikimedia         MediaWiki:Gadget-editsection0.js
svwiki              MediaWiki:ImageAnnotatorConfig.js
svwikinews          MediaWiki:Gadget-editsection0.js
svwikiquote         MediaWiki:Gadget-editsection0.js
urwiki              MediaWiki:ImageAnnotatorConfig.js
viwikisource        MediaWiki:Gadget-Site.js
zhwiki              MediaWiki:Gadget-mainpage-customization.js
zhwiki              MediaWiki:ImageAnnotatorConfig.js
zhwikiversity       MediaWiki:Gadget-twinklespeedy.js
zhwikivoyage        MediaWiki:Gadget-mainpage-customization.js

Looks like many are in comments or in the first two categories (per task description). Doing some migration this weekend with @Krenair.

Krinkle triaged this task as Low priority.Apr 14 2019, 10:22 PM
mwgrep
(0 results)

Thanks @Krenair.

Krinkle updated the task description. (Show Details)Apr 15 2019, 2:29 PM
Krinkle updated the task description. (Show Details)

Change 504070 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] resourceloader: Remove 'wgMainPageTitle' mw.config key

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

kchapman moved this task from Inbox to Doing on the Performance-Team board.Apr 15 2019, 7:56 PM

Change 503551 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] mw.cx.ui.Header: Avoid wgMainPageTitle for simple main page link

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

Change 504070 merged by jenkins-bot:
[mediawiki/core@master] resourceloader: Remove 'wgMainPageTitle' mw.config key

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

Jdforrester-WMF closed this task as Resolved.Apr 16 2019, 3:28 PM
Jdforrester-WMF removed a project: Patch-For-Review.
Johan added a subscriber: Johan.Apr 18 2019, 11:08 AM

I see this has been marked for inclusion in Tech News, but it's actually not used anywhere anymore, right? It's fully migrated?

Krinkle added a comment.EditedApr 18 2019, 12:26 PM

That's right. For Wikimedia wikis I found no more usage and do not think it's worth announcing via Tech News.

It is of course possible that it is indirectly and perhaps accidentally relied upon somewhere, in which case I imagine the announcement wouldn't help to detect or prevent it. So we'd find and mitigate that through our regular bug reporting process.

Quiddity added a subscriber: Quiddity.

removing tag, per previous comment.