* (bug 26851) Special:UserRights now allows to prefill the reason field
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 1 Feb 2011 15:17:25 +0000 (15:17 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 1 Feb 2011 15:17:25 +0000 (15:17 +0000)
The parameter is named "user-reason" as for the form submission

RELEASE-NOTES
includes/specials/SpecialUserrights.php

index d9d9b50..89459c6 100644 (file)
@@ -56,7 +56,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Introduced the edittools-upload message, which will be inserted under the
   upload form instead of edittools if available
 * (bug 26285) Extensions will be automatically generated on upload if the user
-  specified a filename without extension. 
+  specified a filename without extension.
+* (bug 26851) Special:UserRights now allows to prefill the reason field
 
 === Bug fixes in 1.18 ===
 * (bug 23119) WikiError class and subclasses are now marked as deprecated
index 6ea8668..e03f439 100644 (file)
@@ -414,7 +414,7 @@ class UserrightsPage extends SpecialPage {
         * @param $groups    Array:  Array of groups the user is in
         */
        protected function showEditUserGroupsForm( $user, $groups ) {
-               global $wgOut, $wgUser, $wgLang;
+               global $wgOut, $wgUser, $wgLang, $wgRequest;
 
                $list = array();
                foreach( $groups as $group ) {
@@ -453,7 +453,8 @@ class UserrightsPage extends SpecialPage {
                                                Xml::label( wfMsg( 'userrights-reason' ), 'wpReason' ) .
                                        "</td>
                                        <td class='mw-input'>" .
-                                               Xml::input( 'user-reason', 60, false, array( 'id' => 'wpReason', 'maxlength' => 255 ) ) .
+                                               Xml::input( 'user-reason', 60, $wgRequest->getVal( 'user-reason', false ),
+                                                       array( 'id' => 'wpReason', 'maxlength' => 255 ) ) .
                                        "</td>
                                </tr>
                                <tr>