Merge "Soft deprecated EditPage::submit to avoid new use"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 23 Jan 2017 17:47:28 +0000 (17:47 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 23 Jan 2017 17:47:29 +0000 (17:47 +0000)
1  2 
includes/EditPage.php

diff --combined includes/EditPage.php
@@@ -498,6 -498,9 +498,9 @@@ class EditPage 
                $this->enableApiEditOverride = $enableOverride;
        }
  
+       /**
+        * @deprecated since 1.29, call edit directly
+        */
        function submit() {
                $this->edit();
        }
         */
        protected function runPostMergeFilters( Content $content, Status $status, User $user ) {
                // Run old style post-section-merge edit filter
 -              if ( !ContentHandler::runLegacyHooks( 'EditFilterMerged',
 -                      [ $this, $content, &$this->hookError, $this->summary ],
 -                      '1.21'
 -              ) ) {
 -                      # Error messages etc. could be handled within the hook...
 -                      $status->fatal( 'hookaborted' );
 -                      $status->value = self::AS_HOOK_ERROR;
 -                      return false;
 -              } elseif ( $this->hookError != '' ) {
 +              if ( $this->hookError != '' ) {
                        # ...or the hook could be expecting us to produce an error
                        $status->fatal( 'hookaborted' );
                        $status->value = self::AS_HOOK_ERROR_EXPECTED;
@@@ -3573,7 -3584,6 +3576,7 @@@ HTM
         */
        public function getCancelLink() {
                $cancelParams = [];
 +              $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
                if ( !$this->isConflict && $this->oldid > 0 ) {
                        $cancelParams['oldid'] = $this->oldid;
                } elseif ( $this->getContextTitle()->isRedirect() ) {
                }
                $attrs = [ 'id' => 'mw-editform-cancel' ];
  
 -              return Linker::linkKnown(
 +              return $linkRenderer->makeKnownLink(
                        $this->getContextTitle(),
 -                      $this->context->msg( 'cancel' )->parse(),
 +                      new HtmlArmor( $this->context->msg( 'cancel' )->parse() ),
                        Html::buttonAttributes( $attrs, [ 'mw-ui-quiet' ] ),
                        $cancelParams
                );
                        }
  
                        $hook_args = [ $this, &$content ];
 -                      ContentHandler::runLegacyHooks( 'EditPageGetPreviewText', $hook_args, '1.25' );
                        Hooks::run( 'EditPageGetPreviewContent', $hook_args );
  
                        $parserResult = $this->doPreviewParse( $content );