Remove cols and rows preferences
authorChad Horohoe <chadh@wikimedia.org>
Mon, 9 Jan 2017 10:56:41 +0000 (21:56 +1100)
committerThis, that and the other <at.light@live.com.au>
Mon, 9 Jan 2017 10:56:57 +0000 (21:56 +1100)
In https://gerrit.wikimedia.org/r/80061/, Chad was convinced this
preference is barely used and mostly set to weird values by people
who don't understand what they're doing.

He made some quick stats: http://p.defau.lt/?fgGU0StB4J9l0LC5GZq8AA

Used defaults of 80 columns and 25 rows in places that still
were asking for it. The old default values are left in
$wgDefaultUserOptions for now, since various extensions are
using them.

The 'rows' and 'columns' messages don't appear to be in use in
any extensions in Git, so I killed those as well.

(This is the same as I642188c74d929a586b1882a1cf8656056c4fcf5a.)

Bug: T26430
Change-Id: I6c9802bc4f9cf32fb75c3dd7b9e2dc18f271eedf

includes/DefaultSettings.php
includes/EditPage.php
includes/Preferences.php
includes/specials/SpecialUndelete.php
includes/specials/SpecialUpload.php
languages/i18n/en.json
languages/i18n/qqq.json
tests/phpunit/includes/user/UserTest.php

index ffa5c21..856a3f9 100644 (file)
@@ -4788,7 +4788,7 @@ $wgReservedUsernames = [
  */
 $wgDefaultUserOptions = [
        'ccmeonemails' => 0,
-       'cols' => 80,
+       'cols' => 80, // @deprecated since 1.29 No longer used in core
        'date' => 'default',
        'diffonly' => 0,
        'disablemail' => 0,
@@ -4818,7 +4818,7 @@ $wgDefaultUserOptions = [
        'rcdays' => 7,
        'rcenhancedfilters' => 0,
        'rclimit' => 50,
-       'rows' => 25,
+       'rows' => 25, // @deprecated since 1.29 No longer used in core
        'showhiddencats' => 0,
        'shownumberswatching' => 1,
        'showtoolbar' => 1,
index acbd130..05fa366 100644 (file)
@@ -4441,8 +4441,8 @@ HTML
                $attribs = $customAttribs + [
                                'accesskey' => ',',
                                'id' => $name,
-                               'cols' => $user->getIntOption( 'cols' ),
-                               'rows' => $user->getIntOption( 'rows' ),
+                               'cols' => 80,
+                               'rows' => 25,
                                // Avoid PHP notices when appending preferences
                                // (appending allows customAttribs['style'] to still work).
                                'style' => ''
index 263ff5b..89982a6 100644 (file)
@@ -55,8 +55,6 @@ class Preferences {
        /** @var array */
        protected static $saveFilters = [
                'timecorrection' => [ 'Preferences', 'filterTimezoneInput' ],
-               'cols' => [ 'Preferences', 'filterIntval' ],
-               'rows' => [ 'Preferences', 'filterIntval' ],
                'rclimit' => [ 'Preferences', 'filterIntval' ],
                'wllimit' => [ 'Preferences', 'filterIntval' ],
                'searchlimit' => [ 'Preferences', 'filterIntval' ],
@@ -817,20 +815,7 @@ class Preferences {
                                ]
                        ];
                }
-               $defaultPreferences['cols'] = [
-                       'type' => 'int',
-                       'label-message' => 'columns',
-                       'section' => 'editing/editor',
-                       'min' => 4,
-                       'max' => 1000,
-               ];
-               $defaultPreferences['rows'] = [
-                       'type' => 'int',
-                       'label-message' => 'rows',
-                       'section' => 'editing/editor',
-                       'min' => 4,
-                       'max' => 1000,
-               ];
+
                if ( $user->isAllowed( 'minoredit' ) ) {
                        $defaultPreferences['minordefault'] = [
                                'type' => 'toggle',
@@ -838,6 +823,7 @@ class Preferences {
                                'label-message' => 'tog-minordefault',
                        ];
                }
+
                $defaultPreferences['forceeditsummary'] = [
                        'type' => 'toggle',
                        'section' => 'editing/editor',
index 3d51842..4c6a593 100644 (file)
@@ -1141,8 +1141,8 @@ class SpecialUndelete extends SpecialPage {
                                'textarea',
                                [
                                        'readonly' => 'readonly',
-                                       'cols' => $user->getIntOption( 'cols' ),
-                                       'rows' => $user->getIntOption( 'rows' )
+                                       'cols' => 80,
+                                       'rows' => 25
                                ],
                                $content->getNativeData() . "\n"
                        );
index aabd450..8b8e514 100644 (file)
@@ -1118,7 +1118,7 @@ class UploadForm extends HTMLForm {
                                        ? 'filereuploadsummary'
                                        : 'fileuploadsummary',
                                'default' => $this->mComment,
-                               'cols' => $this->getUser()->getIntOption( 'cols' ),
+                               'cols' => 80,
                                'rows' => 8,
                        ]
                ];
index a621f1c..ea07d78 100644 (file)
        "saveprefs": "Save",
        "restoreprefs": "Restore all default settings (in all sections)",
        "prefs-editing": "Editing",
-       "rows": "Rows:",
-       "columns": "Columns:",
        "searchresultshead": "Search",
        "stub-threshold": "Threshold for stub link formatting ($1):",
        "stub-threshold-sample-link": "sample",
index 372a127..a795484 100644 (file)
        "saveprefs": "Button for saving changes in the preferences page.\n\nSee also:\n* {{msg-mw|Saveprefs}}\n* {{msg-mw|Accesskey-preferences-save}}\n* {{msg-mw|Tooltip-preferences-save}}\n{{Identical|Save}}",
        "restoreprefs": "Used as link text in [[Special:Preferences]]. The link points to [[Special:Preferences/reset]] which shows the \"Restore all default settings\" form.\n\nAlso used as label for the Submit button in [[Special:Preferences/reset]].",
        "prefs-editing": "Title of a tab in [[Special:Preferences]].\nWhen changing this message, please also update {{msg-mw|vector-editwarning-warning}} which references to this message.\n{{Identical|Editing}}",
-       "rows": "Used on [[Special:Preferences]], \"Editing\" section in the \"Size of editing window\" fieldset.\n{{Identical|Row}}",
-       "columns": "Used on [[Special:Preferences]], \"Editing\" section in the \"Size of editing window\" fieldset.\n{{Identical|Column}}",
        "searchresultshead": "Replaced by {{msg-mw|prefs-searchoptions}}, though may still be used in some extensions. DEPRECATED.\n\n{{Identical|Search}}",
        "stub-threshold": "Used in [[Special:Preferences]], \"Advanced options\" section. The setting allows the user to select a threshold value, in bytes, from a predefined list of options. Any links that lead to pages smaller than the threshold (\"stub links\") will be styled differently.\n\nParameters:\n* $1: the text of {{msg-mw|stub-threshold-sample-link}}, styled as a stub link",
        "stub-threshold-sample-link": "Passed as a parameter to the {{msg-mw|stub-threshold}} message.\n{{Identical|Sample}}",
index 94c6b4f..fe56d27 100644 (file)
@@ -345,18 +345,18 @@ class UserTest extends MediaWikiTestCase {
                $user = $this->getMutableTestUser()->getUser();
 
                $user->setOption( 'userjs-someoption', 'test' );
-               $user->setOption( 'cols', 200 );
+               $user->setOption( 'rclimit', 200 );
                $user->saveSettings();
 
                $user = User::newFromName( $user->getName() );
                $user->load( User::READ_LATEST );
                $this->assertEquals( 'test', $user->getOption( 'userjs-someoption' ) );
-               $this->assertEquals( 200, $user->getOption( 'cols' ) );
+               $this->assertEquals( 200, $user->getOption( 'rclimit' ) );
 
                $user = User::newFromName( $user->getName() );
                MediaWikiServices::getInstance()->getMainWANObjectCache()->clearProcessCache();
                $this->assertEquals( 'test', $user->getOption( 'userjs-someoption' ) );
-               $this->assertEquals( 200, $user->getOption( 'cols' ) );
+               $this->assertEquals( 200, $user->getOption( 'rclimit' ) );
        }
 
        /**
@@ -367,7 +367,7 @@ class UserTest extends MediaWikiTestCase {
        public function testAnonOptions() {
                global $wgDefaultUserOptions;
                $this->user->setOption( 'userjs-someoption', 'test' );
-               $this->assertEquals( $wgDefaultUserOptions['cols'], $this->user->getOption( 'cols' ) );
+               $this->assertEquals( $wgDefaultUserOptions['rclimit'], $this->user->getOption( 'rclimit' ) );
                $this->assertEquals( 'test', $this->user->getOption( 'userjs-someoption' ) );
        }