From a5853433dad7a1aba91940cd6ac79480008671ee Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Sun, 29 Jul 2018 16:30:39 +0300 Subject: [PATCH] Remove long-dead OutputPage methods set/getPageTitleActionText() They were accidentally made non-functional in April 2009 by commit e4d21170. Subsequent commits 2d045fa1, 9e230f30, e275ea28, ae45908c removed all callers by October 2011. Needless to say, I found no callers in core or extensions. It seems we have the functionality in some other way, probably just by directly calling setHTMLTitle(), so there's no need to revive this feature. Bug: T200643 Change-Id: Ifa2537b97cf19e7e91ee33d4ea4c131f7a38ee89 --- RELEASE-NOTES-1.32 | 3 +++ includes/OutputPage.php | 22 ---------------------- tests/phpunit/includes/OutputPageTest.php | 13 ------------- 3 files changed, 3 insertions(+), 35 deletions(-) diff --git a/RELEASE-NOTES-1.32 b/RELEASE-NOTES-1.32 index baa520c607..95459b2748 100644 --- a/RELEASE-NOTES-1.32 +++ b/RELEASE-NOTES-1.32 @@ -231,6 +231,9 @@ because of Phabricator reports. * getItemsData: Use getItems instead and get the data property * Two OutputPage methods, addMetadataLink() and getMetadataAttribute(), were removed. Use addLink() instead. +* Another two OutputPage methods, setPageTitleActionText() and + getPageTitleActionText(), were removed. They did nothing since 1.15 (almost + ten years). Use setHTMLTitle() directly. * All MagicWord static member variables have been removed. Use appropriate hooks or MagicWordFactory methods instead. * MagicWord::clearCache() has been removed. Instead, create a new diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 19810fc174..aa517e7608 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -222,9 +222,6 @@ class OutputPage extends ContextSource { */ public $mNoGallery = false; - /** @var string */ - private $mPageTitleActionText = ''; - /** @var int Cache stuff. Looks like mEnableClientCache */ protected $mCdnMaxage = 0; /** @var int Upper limit on mCdnMaxage */ @@ -894,25 +891,6 @@ class OutputPage extends ContextSource { } } - /** - * Set the new value of the "action text", this will be added to the - * "HTML title", separated from it with " - ". - * - * @param string $text New value of the "action text" - */ - public function setPageTitleActionText( $text ) { - $this->mPageTitleActionText = $text; - } - - /** - * Get the value of the "action text" - * - * @return string - */ - public function getPageTitleActionText() { - return $this->mPageTitleActionText; - } - /** * "HTML title" means the contents of "". * It is stored as plain, unescaped text and will be run through htmlspecialchars in the skin file. diff --git a/tests/phpunit/includes/OutputPageTest.php b/tests/phpunit/includes/OutputPageTest.php index d3c7af515c..efd61a7f93 100644 --- a/tests/phpunit/includes/OutputPageTest.php +++ b/tests/phpunit/includes/OutputPageTest.php @@ -452,19 +452,6 @@ class OutputPageTest extends MediaWikiTestCase { $this->assertContains( '<meta name="robots" content="noindex,nofollow"/>', $links ); } - // @todo mPageTitleActionText has done nothing and has no callers for a long time: - // - // * e4d21170 inadvertently made it do nothing (Apr 2009) - // * 10ecfcb0/cadc951d removed the dead code that would have at least indicated what it was - // supposed to do (Nov 2010) - // * 9e230f30/2d045fa1 removed from history pages because it did nothing (Oct/Aug 2011) - // * e275ea28 removed from articles (Oct 2011) - // * ae45908c removed from EditPage (Oct 2011) - // - // Nice if we had had tests so these things couldn't happen by mistake, right?! - // - // https://phabricator.wikimedia.org/T200643 - private function extractHTMLTitle( OutputPage $op ) { $html = $op->headElement( $op->getContext()->getSkin() ); -- 2.20.1