jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/333364 )

Change subject: Revert "Added reason suggestion in block/delete/protect forms"
......................................................................


Revert "Added reason suggestion in block/delete/protect forms"

See the task, this was probably entirely my fault not having
looked at this more carefully. Technically the change is ok,
however, it seems to doesn't make much sense in combination
with the Reason dropdown box.

This reverts commit faab2411c29a2ad0851c596f1cadfec1d7e06892.

Task: T34950
Change-Id: I1eeb9c68ff0db20d29e7d5f0fb18f0bfa3224416
---
M RELEASE-NOTES-1.29
M includes/ProtectionForm.php
M includes/page/Article.php
M includes/specials/SpecialBlock.php
M resources/Resources.php
D resources/src/mediawiki/mediawiki.reasonSuggest.js
6 files changed, 2 insertions(+), 59 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/RELEASE-NOTES-1.29 b/RELEASE-NOTES-1.29
index fac6f7e..53bd1bf 100644
--- a/RELEASE-NOTES-1.29
+++ b/RELEASE-NOTES-1.29
@@ -44,8 +44,6 @@
   from certain IP ranges (e.g. private IPs).
 * (T59603) Added new magic word {{PAGELANGUAGE}} which returns the language 
code
   of the page being parsed.
-* Added JavaScript that provides as-you-type suggestions for reason
-  on the block, delete and protect forms.
 * HTML5 form validation attributes will no longer be suppressed. Originally
   browsers had poor support for them, but modern browsers handle them fine.
   This might affect some forms that used them and only worked because the
diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php
index bcf4dda..454ffcc 100644
--- a/includes/ProtectionForm.php
+++ b/includes/ProtectionForm.php
@@ -182,21 +182,10 @@
                        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();
diff --git a/includes/page/Article.php b/includes/page/Article.php
index a33c84f..ba29b01 100644
--- a/includes/page/Article.php
+++ b/includes/page/Article.php
@@ -1672,15 +1672,6 @@
                $title = $this->getTitle();
                $ctx = $this->getContext();
                $outputPage = $ctx->getOutput();
-               if ( !wfMessage( 'deletereason-dropdown' 
)->inContentLanguage()->isDisabled() ) {
-                       $reasonsList = Xml::getArrayFromWikiTextList(
-                               wfMessage( 'deletereason-dropdown' 
)->inContentLanguage()->text()
-                       );
-                       $outputPage->addModules( 'mediawiki.reasonSuggest' );
-                       $outputPage->addJsConfigVars( [
-                               'reasons' => $reasonsList
-                       ] );
-               }
                $useMediaWikiUIEverywhere = $ctx->getConfig()->get( 
'UseMediaWikiUIEverywhere' );
                $outputPage->setPageTitle( wfMessage( 'delete-confirm', 
$title->getPrefixedText() ) );
                $outputPage->addBacklinkSubtitle( $title );
diff --git a/includes/specials/SpecialBlock.php 
b/includes/specials/SpecialBlock.php
index 82f7d08..93cb377 100644
--- a/includes/specials/SpecialBlock.php
+++ b/includes/specials/SpecialBlock.php
@@ -127,15 +127,7 @@
         */
        protected function getFormFields() {
                global $wgBlockAllowsUTEdit;
-               if ( !wfMessage( 'ipbreason-dropdown' 
)->inContentLanguage()->isDisabled() ) {
-                       $reasonsList = Xml::getArrayFromWikiTextList(
-                               wfMessage( 'ipbreason-dropdown' 
)->inContentLanguage()->text()
-                       );
-                       $this->getOutput()->addModules( 
'mediawiki.reasonSuggest' );
-                       $this->getOutput()->addJsConfigVars( [
-                               'reasons' => $reasonsList
-                       ] );
-               }
+
                $user = $this->getUser();
 
                $suggestedDurations = self::getSuggestedDurations();
diff --git a/resources/Resources.php b/resources/Resources.php
index 7c00feb..e8c27ab 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -1395,13 +1395,6 @@
                ],
                'targets' => [ 'desktop', 'mobile' ],
        ],
-       'mediawiki.reasonSuggest' => [
-               'scripts' => 
'resources/src/mediawiki/mediawiki.reasonSuggest.js',
-               'dependencies' => [
-                       'jquery.suggestions',
-                       'mediawiki.api.messages'
-               ]
-       ],
        'mediawiki.userSuggest' => [
                'scripts' => 'resources/src/mediawiki/mediawiki.userSuggest.js',
                'dependencies' => [
diff --git a/resources/src/mediawiki/mediawiki.reasonSuggest.js 
b/resources/src/mediawiki/mediawiki.reasonSuggest.js
deleted file mode 100644
index 71efdb0..0000000
--- a/resources/src/mediawiki/mediawiki.reasonSuggest.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/*!
-* Add autocomplete suggestions for action forms reasons.
-*/
-( function ( mw, $ ) {
-       $( function () {
-               var reasons = mw.config.get( 'reasons' );
-
-               // Add relevant suggestion
-               $( '#mwProtect-reason, #wpReason, #mw-input-wpReason-other' 
).suggestions( {
-                       fetch: function () {
-                               var $this = $( this ), relevantSuggestions;
-                               relevantSuggestions = $.grep( reasons, function 
( reason ) {
-                                       return ( reason.toLowerCase().indexOf( 
$this.val().toLowerCase() ) > -1 );
-                               } );
-                               $this.suggestions( 'suggestions', 
relevantSuggestions );
-                       },
-                       highlightInput: true
-               } );
-       } );
-}( mediaWiki, jQuery ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/333364
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1eeb9c68ff0db20d29e7d5f0fb18f0bfa3224416
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.29.0-wmf.8
Gerrit-Owner: Legoktm <lego...@member.fsf.org>
Gerrit-Reviewer: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com>
Gerrit-Reviewer: Jack Phoenix <j...@countervandalism.net>
Gerrit-Reviewer: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: Legoktm <lego...@member.fsf.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to