Merge "Make EditPage::incrementConflictStats protected"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 28 Feb 2017 18:35:53 +0000 (18:35 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 28 Feb 2017 18:35:53 +0000 (18:35 +0000)
1  2 
includes/EditPage.php

diff --combined includes/EditPage.php
@@@ -993,7 -993,7 +993,7 @@@ class EditPage 
                        $this->recreate = false;
  
                        // When creating a new section, we can preload a section title by passing it as the
 -                      // preloadtitle parameter in the URL (Bug 13100)
 +                      // preloadtitle parameter in the URL (T15100)
                        if ( $this->section == 'new' && $request->getVal( 'preloadtitle' ) ) {
                                $this->sectiontitle = $request->getVal( 'preloadtitle' );
                                // Once wpSummary isn't being use for setting section titles, we should delete this.
                $revision = $this->mArticle->getRevisionFetched();
                if ( $revision === null ) {
                        if ( !$this->contentModel ) {
 -                              $this->contentModel = $this->getTitle()->getContentModel();
 +                              throw new RuntimeException( 'EditPage contentModel was false' );
                        }
                        $handler = ContentHandler::getForModelID( $this->contentModel );
  
  
                if ( $content === false || $content === null ) {
                        if ( !$this->contentModel ) {
 -                              $this->contentModel = $this->getTitle()->getContentModel();
 +                              throw new RuntimeException( 'EditPage contentModel was false' );
                        }
                        $handler = ContentHandler::getForModelID( $this->contentModel );
  
  
                        // Don't save a new page if it's blank or if it's a MediaWiki:
                        // message with content equivalent to default (allow empty pages
 -                      // in this case to disable messages, see bug 50124)
 +                      // in this case to disable messages, see T52124)
                        $defaultMessageText = $this->mTitle->getDefaultMessageText();
                        if ( $this->mTitle->getNamespace() === NS_MEDIAWIKI && $defaultMessageText !== false ) {
                                $defaultText = $defaultMessageText;
                }
                # Give a notice if the user is editing a deleted/moved page...
                if ( !$this->mTitle->exists() ) {
 +                      $dbr = wfGetDB( DB_REPLICA );
 +
                        LogEventsList::showLogExtract( $wgOut, [ 'delete', 'move' ], $this->mTitle,
                                '',
                                [
                                        'lim' => 10,
 -                                      'conds' => [ "log_action != 'revision'" ],
 +                                      'conds' => [ 'log_action != ' . $dbr->addQuotes( 'revision' ) ],
                                        'showIfEmpty' => false,
                                        'msgKey' => [ 'recreate-moveddeleted-warn' ]
                                ]
                if ( $this->hasPresetSummary ) {
                        // If a summary has been preset using &summary= we don't want to prompt for
                        // a different summary. Only prompt for a summary if the summary is blanked.
 -                      // (Bug 17416)
 +                      // (T19416)
                        $this->autoSumm = md5( '' );
                }
  
@@@ -3565,7 -3563,7 +3565,7 @@@ HTM
                }
        }
  
-       private function incrementConflictStats() {
+       protected function incrementConflictStats() {
                $stats = MediaWikiServices::getInstance()->getStatsdDataFactory();
                $stats->increment( 'edit.failures.conflict' );
                // Only include 'standard' namespaces to avoid creating unknown numbers of statsd metrics