EditPage::getContextTitle(): Deprecate falling back to $wgTitle
authorJames D. Forrester <jforrester@wikimedia.org>
Tue, 12 Jun 2018 17:44:44 +0000 (10:44 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Thu, 14 Jun 2018 15:25:15 +0000 (17:25 +0200)
Bug: T176526
Change-Id: I7b692def1695119291b26b2f2d25064af9e621f7

RELEASE-NOTES-1.32
includes/EditPage.php

index 5dbf873..731f874 100644 (file)
@@ -211,6 +211,9 @@ because of Phabricator reports.
   it had unexpected behavior (only marking text if it looked like a URL)
   and was only used in a single place in the code.  Use
   LanguageConverter::markNoConversion() instead.
+* (T176526) EditPage::getContextTitle() falling back to $wgTitle when the
+  context title is unset is now deprecated; anything creating an EditPage
+  instance should set the context title via ::setContextTitle().
 
 === Other changes in 1.32 ===
 * …
index 9aa6550..9209761 100644 (file)
@@ -486,17 +486,15 @@ class EditPage {
 
        /**
         * Get the context title object.
-        * If not set, $wgTitle will be returned. This behavior might change in
-        * the future to return $this->mTitle instead.
+        *
+        * If not set, $wgTitle will be returned, but this is deprecated. This will
+        * throw an exception.
         *
         * @return Title
         */
        public function getContextTitle() {
                if ( is_null( $this->mContextTitle ) ) {
-                       wfDebugLog(
-                               'GlobalTitleFail',
-                               __METHOD__ . ' called by ' . wfGetAllCallers( 5 ) . ' with no title set.'
-                       );
+                       wfDeprecated( __METHOD__ . ' called with no title set', '1.32' );
                        global $wgTitle;
                        return $wgTitle;
                } else {