Demon has uploaded a new change for review. https://gerrit.wikimedia.org/r/80061
Change subject: Remove cols and rows preferences ...................................................................... Remove cols and rows preferences I'm convinced this preference is barely used and mostly set to weird values by people who don't understand what they're doing. Used defaults of 80 columns and 25 rows in places that still were asking for it. Didn't delete the rows/columns messages because I wasn't sure what else might still be using them. Change-Id: I642188c74d929a586b1882a1cf8656056c4fcf5a See-Also: http://p.defau.lt/?fgGU0StB4J9l0LC5GZq8AA Bug: 24430 --- M includes/DefaultSettings.php M includes/EditPage.php M includes/OutputPage.php M includes/Preferences.php M includes/specials/SpecialUndelete.php M includes/specials/SpecialUpload.php M tests/phpunit/includes/UserTest.php 7 files changed, 7 insertions(+), 29 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/61/80061/1 diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 8396805..210528f 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -3907,7 +3907,6 @@ */ $wgDefaultUserOptions = array( 'ccmeonemails' => 0, - 'cols' => 80, 'date' => 'default', 'diffonly' => 0, 'disablemail' => 0, @@ -3940,7 +3939,6 @@ 'rcdays' => 7, 'rclimit' => 50, 'rememberpassword' => 0, - 'rows' => 25, 'searchlimit' => 20, 'showhiddencats' => 0, 'shownumberswatching' => 1, diff --git a/includes/EditPage.php b/includes/EditPage.php index 7c7bfe9..ce44484 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -2678,8 +2678,8 @@ $attribs = $customAttribs + array( 'accesskey' => ',', 'id' => $name, - 'cols' => $wgUser->getIntOption( 'cols' ), - 'rows' => $wgUser->getIntOption( 'rows' ), + 'cols' => 80, + 'rows' => 25, 'style' => '' // avoid php notices when appending preferences (appending allows customAttribs['style'] to still work ); diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 83a7d3f..aed9223 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2345,8 +2345,8 @@ $params = array( 'id' => 'wpTextbox1', 'name' => 'wpTextbox1', - 'cols' => $this->getUser()->getOption( 'cols' ), - 'rows' => $this->getUser()->getOption( 'rows' ), + 'cols' => 80, + 'rows' => 25, 'readonly' => 'readonly', 'lang' => $pageLang->getHtmlCode(), 'dir' => $pageLang->getDir(), diff --git a/includes/Preferences.php b/includes/Preferences.php index 9791d8b..67820b1 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -49,8 +49,6 @@ static $defaultPreferences = null; static $saveFilters = array( 'timecorrection' => array( 'Preferences', 'filterTimezoneInput' ), - 'cols' => array( 'Preferences', 'filterIntval' ), - 'rows' => array( 'Preferences', 'filterIntval' ), 'rclimit' => array( 'Preferences', 'filterIntval' ), 'wllimit' => array( 'Preferences', 'filterIntval' ), 'searchlimit' => array( 'Preferences', 'filterIntval' ), @@ -796,20 +794,6 @@ ) ); } - $defaultPreferences['cols'] = array( - 'type' => 'int', - 'label-message' => 'columns', - 'section' => 'editing/editor', - 'min' => 4, - 'max' => 1000, - ); - $defaultPreferences['rows'] = array( - 'type' => 'int', - 'label-message' => 'rows', - 'section' => 'editing/editor', - 'min' => 4, - 'max' => 1000, - ); if ( $user->isAllowed( 'minoredit' ) ) { $defaultPreferences['minordefault'] = array( 'type' => 'toggle', diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index d4aed11..446465b 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -970,8 +970,8 @@ 'textarea', array( 'readonly' => 'readonly', - 'cols' => $user->getIntOption( 'cols' ), - 'rows' => $user->getIntOption( 'rows' ) + 'cols' => 80, + 'rows' => 25 ), $content->getNativeData() . "\n" ); diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index 3a057ea..c2db1a5 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -935,7 +935,7 @@ ? 'filereuploadsummary' : 'fileuploadsummary', 'default' => $this->mComment, - 'cols' => $this->getUser()->getIntOption( 'cols' ), + 'cols' => 80, 'rows' => 8, ) ); diff --git a/tests/phpunit/includes/UserTest.php b/tests/phpunit/includes/UserTest.php index 0113cab..66654bf 100644 --- a/tests/phpunit/includes/UserTest.php +++ b/tests/phpunit/includes/UserTest.php @@ -201,12 +201,10 @@ $user->addToDatabase(); $user->setOption( 'someoption', 'test' ); - $user->setOption( 'cols', 200 ); $user->saveSettings(); $user = User::newFromName( 'UnitTestUser' ); $this->assertEquals( 'test', $user->getOption( 'someoption' ) ); - $this->assertEquals( 200, $user->getOption( 'cols' ) ); } /** @@ -214,9 +212,7 @@ * Make sure defaults are loaded when setOption is called. */ public function testAnonOptions() { - global $wgDefaultUserOptions; $this->user->setOption( 'someoption', 'test' ); - $this->assertEquals( $wgDefaultUserOptions['cols'], $this->user->getOption( 'cols' ) ); $this->assertEquals( 'test', $this->user->getOption( 'someoption' ) ); } } -- To view, visit https://gerrit.wikimedia.org/r/80061 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I642188c74d929a586b1882a1cf8656056c4fcf5a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Demon <ch...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits