summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjdlrobson <jdlrobson@gmail.com>2021-12-22 13:29:31 -0800
committerJdlrobson <jrobson@wikimedia.org>2021-12-23 22:40:27 +0000
commitae411974c9cf2daa7d77266af4a04cd37b9da7c6 (patch)
tree1240ab600cf4282be5592901d514335fc717ee59
parent2f082ce80fb93ace23019c77dc28127b178709fd (diff)
Hiding main page heading should not hide title on diff/history views
Now editors can hide the main page by an edit to MediaWiki:mainpage-title When that happens the heading should only hide on the article. Bug: T297019 Bug: T38294 Change-Id: I69512c649be6ed3b3bcd9c5f8b0f7d3258f2f87e
-rw-r--r--includes/skins/Skin.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php
index 35588461c5ce..c24fac5ca04e 100644
--- a/includes/skins/Skin.php
+++ b/includes/skins/Skin.php
@@ -146,8 +146,12 @@ abstract class Skin extends ContextSource {
$user = $this->getUser();
$isMainPage = $title->isMainPage();
$blankedHeading = false;
+ // Heading can only be blanked on "views". It should
+ // still show on action=edit, diff pages and action=history
+ $isHeadingOverridable = $this->getAction() === 'view' &&
+ !$this->getRequest()->getRawVal( 'diff' );
- if ( $isMainPage ) {
+ if ( $isMainPage && $isHeadingOverridable ) {
// Special casing for the main page to allow more freedom to editors, to
// design their home page differently. This came up in T290480.
// The parameter for logged in users is optional and may