Merge "Remove global namespaced LBFactory"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 21 Sep 2018 23:40:45 +0000 (23:40 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 21 Sep 2018 23:40:45 +0000 (23:40 +0000)
RELEASE-NOTES-1.32
includes/CommentStore.php
includes/diff/DifferenceEngine.php
includes/preferences/DefaultPreferencesFactory.php
includes/tidy/RaggettBase.php
tests/phpunit/includes/ActorMigrationTest.php
tests/phpunit/includes/CommentStoreTest.php

index 32ef63c..fb2829b 100644 (file)
@@ -454,8 +454,8 @@ because of Phabricator reports.
   in MediaWiki 1.26, have now been hard deprecated. This affects $wgUseTidy,
   $wgTidyBin, $wgTidyConf, $wgTidyOpts, $wgTidyInternal, and $wgDebugTidy. Use
   $wgTidyConfig instead.
-* All Tidy configurations other than Remex have been deprecated; future parsers
-  will not emit compatible output for these configurations.
+* All Tidy configurations other than Remex have been hard deprecated;
+  future parsers will not emit compatible output for these configurations.
 
 === Other changes in 1.32 ===
 * (T198811) The following tables have had their UNIQUE indexes turned into
index bf3e3d6..9969b78 100644 (file)
@@ -115,8 +115,7 @@ class CommentStore {
         */
        public static function newKey( $key ) {
                global $wgCommentTableSchemaMigrationStage;
-               // TODO uncomment once not used in extensions
-               // wfDeprecated( __METHOD__, '1.31' );
+               wfDeprecated( __METHOD__, '1.31' );
                $store = new CommentStore( MediaWikiServices::getInstance()->getContentLanguage(),
                        $wgCommentTableSchemaMigrationStage );
                $store->key = $key;
index 387e9e3..9602bd2 100644 (file)
@@ -848,6 +848,7 @@ class DifferenceEngine extends ContextSource {
                                // New revision is unsaved; bail out.
                                // TODO in theory rendering the new revision is a meaningful thing to do
                                // even if it's unsaved, but a lot of untangling is required to do it safely.
+                               return;
                        }
 
                        $out->setRevisionId( $this->mNewid );
index ec85556..0da8c45 100644 (file)
@@ -981,14 +981,14 @@ class DefaultPreferencesFactory implements PreferencesFactory {
                        'type' => 'float',
                        'label-message' => 'recentchangesdays',
                        'section' => 'rc/displayrc',
-                       'min' => 1,
+                       'min' => 1 / 24,
                        'max' => ceil( $rcMaxAge / ( 3600 * 24 ) ),
                        'help' => $l10n->msg( 'recentchangesdays-max' )->numParams(
                                ceil( $rcMaxAge / ( 3600 * 24 ) ) )->escaped()
                ];
                $defaultPreferences['rclimit'] = [
                        'type' => 'int',
-                       'min' => 0,
+                       'min' => 1,
                        'max' => 1000,
                        'label-message' => 'recentchangescount',
                        'help-message' => 'prefs-help-recentchangescount',
index ed91735..878099f 100644 (file)
@@ -8,6 +8,14 @@ use MWException;
  * @deprecated since 1.32, use RemexDriver
  */
 abstract class RaggettBase extends TidyDriverBase {
+
+       function __construct( $config ) {
+               parent::__construct( $config );
+
+               // All tidy modes other than remex are deprecated.
+               wfDeprecated( __METHOD__, '1.32' );
+       }
+
        /**
         * Generic interface for wrapping and unwrapping HTML for Dave Raggett's tidy.
         *
index d28be7a..c938750 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
 use MediaWiki\User\UserIdentity;
+use MediaWiki\MediaWikiServices;
 use Wikimedia\TestingAccessWrapper;
 
 /**
@@ -635,8 +636,8 @@ class ActorMigrationTest extends MediaWikiLangTestCase {
                $userIdentity->method( 'getName' )->willReturn( $user->getName() );
                $userIdentity->method( 'getActorId' )->willReturn( 0 );
 
-               list( $cFields, $cCallback ) = CommentStore::newKey( 'rev_comment' )
-                       ->insertWithTempTable( $this->db, '' );
+               list( $cFields, $cCallback ) = MediaWikiServices::getInstance()->getCommentStore()
+                       ->insertWithTempTable( $this->db, 'rev_comment', '' );
                $m = $this->makeMigration( MIGRATION_WRITE_BOTH );
                list( $fields, $callback ) =
                        $m->getInsertValuesWithTempTable( $this->db, 'rev_user', $userIdentity );
index f9b592e..0c5d8e3 100644 (file)
@@ -35,6 +35,7 @@ class CommentStoreTest extends MediaWikiLangTestCase {
         * @return CommentStore
         */
        protected function makeStoreWithKey( $stage, $key ) {
+               $this->hideDeprecated( 'CommentStore::newKey' );
                $store = CommentStore::newKey( $key );
                TestingAccessWrapper::newFromObject( $store )->stage = $stage;
                return $store;
@@ -774,6 +775,7 @@ class CommentStoreTest extends MediaWikiLangTestCase {
        }
 
        public function testNewKey() {
+               $this->hideDeprecated( 'CommentStore::newKey' );
                $this->assertInstanceOf( CommentStore::class, CommentStore::newKey( 'dummy' ) );
        }