From 5fb7c116b7013335ca74a1e1469988007ca322ab Mon Sep 17 00:00:00 2001 From: David Lynch Date: Tue, 8 Jun 2021 23:01:43 -0500 Subject: [PATCH] Add hook that allows suppression of the talk page overlay The hook lets us hand off the decision of whether to suppress this to DiscussionTools, which has a slightly complex set of feature-tests to do before deciding. It seems better to leave this disabled only when DT will actually be stepping in. Bug: T280051 Change-Id: If6b70fb6d801ac04fa3b70c153a2136d2e302f28 --- includes/Skins/SkinMinerva.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/includes/Skins/SkinMinerva.php b/includes/Skins/SkinMinerva.php index 17ada46f5..0a8ff9698 100644 --- a/includes/Skins/SkinMinerva.php +++ b/includes/Skins/SkinMinerva.php @@ -484,6 +484,12 @@ class SkinMinerva extends SkinMustache { private function isTalkPageWithViewAction() { $title = $this->getTitle(); + // Hook is @unstable and only for use by DiscussionTools. Do not use for any other purpose. + $hookContainer = MediaWikiServices::getInstance()->getHookContainer(); + if ( !$hookContainer->run( 'MinervaNeueTalkPageOverlay', [ $title, $this->getOutput() ] ) ) { + return false; + } + return $title->isTalkPage() && Action::getActionName( $this->getContext() ) === "view"; }