Merge "EditPage: Try to avoid using $wgTitle"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 20 Sep 2017 15:59:47 +0000 (15:59 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 20 Sep 2017 15:59:47 +0000 (15:59 +0000)
includes/EditPage.php
includes/actions/EditAction.php

index 54b4cf5..0ea61c0 100644 (file)
@@ -469,6 +469,10 @@ class EditPage {
         */
        public function getContextTitle() {
                if ( is_null( $this->mContextTitle ) ) {
+                       wfDebugLog(
+                               'GlobalTitleFail',
+                               __METHOD__ . ' called by ' . wfGetAllCallers( 5 ) . ' with no title set.'
+                       );
                        global $wgTitle;
                        return $wgTitle;
                } else {
index acfd72e..f0bc8bf 100644 (file)
@@ -56,6 +56,7 @@ class EditAction extends FormlessAction {
 
                if ( Hooks::run( 'CustomEditor', [ $page, $user ] ) ) {
                        $editor = new EditPage( $page );
+                       $editor->setContextTitle( $this->getTitle() );
                        $editor->edit();
                }
        }