Remove long-dead OutputPage methods set/getPageTitleActionText()
authorAryeh Gregor <ayg@aryeh.name>
Sun, 29 Jul 2018 13:30:39 +0000 (16:30 +0300)
committerLegoktm <legoktm@member.fsf.org>
Wed, 1 Aug 2018 10:14:42 +0000 (10:14 +0000)
They were accidentally made non-functional in April 2009 by commit
e4d21170.  Subsequent commits 2d045fa19e230f30e275ea28ae45908c
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
includes/OutputPage.php
tests/phpunit/includes/OutputPageTest.php

index baa520c..95459b2 100644 (file)
@@ -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
index 19810fc..aa517e7 100644 (file)
@@ -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 "<title>".
         * It is stored as plain, unescaped text and will be run through htmlspecialchars in the skin file.
index d3c7af5..efd61a7 100644 (file)
@@ -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() );