Merge "Revert "Added reason suggestion in block/delete/protect forms""
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 21 Jan 2017 19:47:27 +0000 (19:47 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 21 Jan 2017 19:47:27 +0000 (19:47 +0000)
1  2 
includes/ProtectionForm.php

@@@ -22,7 -22,6 +22,7 @@@
   *
   * @file
   */
 +use MediaWiki\MediaWikiServices;
  
  /**
   * Handles the page protection UI and backend
@@@ -183,21 -182,10 +183,10 @@@ class ProtectionForm 
                        throw new ErrorPageError( 'protect-badnamespace-title', 'protect-badnamespace-text' );
                }
  
-               $out = $this->mContext->getOutput();
-               if ( !wfMessage( 'protect-dropdown' )->inContentLanguage()->isDisabled() ) {
-                       $reasonsList = Xml::getArrayFromWikiTextList(
-                               wfMessage( 'protect-dropdown' )->inContentLanguage()->text()
-                       );
-                       $out->addModules( 'mediawiki.reasonSuggest' );
-                       $out->addJsConfigVars( [
-                               'reasons' => $reasonsList
-                       ] );
-               }
                if ( $this->mContext->getRequest()->wasPosted() ) {
                        if ( $this->save() ) {
                                $q = $this->mArticle->isRedirect() ? 'redirect=no' : '';
-                               $out->redirect( $this->mTitle->getFullURL( $q ) );
+                               $this->mContext->getOutput()->redirect( $this->mTitle->getFullURL( $q ) );
                        }
                } else {
                        $this->show();
                $out .= Xml::closeElement( 'fieldset' );
  
                if ( $user->isAllowed( 'editinterface' ) ) {
 -                      $link = Linker::linkKnown(
 +                      $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
 +                      $link = $linkRenderer->makeKnownLink(
                                $context->msg( 'protect-dropdown' )->inContentLanguage()->getTitle(),
 -                              $context->msg( 'protect-edit-reasonlist' )->escaped(),
 +                              $context->msg( 'protect-edit-reasonlist' )->text(),
                                [],
                                [ 'action' => 'edit' ]
                        );