Fix error in various deprecated selectFields() methods
[lhc/web/wiklou.git] / includes / filerepo / file / OldLocalFile.php
index 3a6b879..b5c44f2 100644 (file)
@@ -21,6 +21,8 @@
  * @ingroup FileAbstraction
  */
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * Class to represent a file in the oldimage table
  *
@@ -136,11 +138,11 @@ class OldLocalFile extends LocalFile {
                        'oi_minor_mime',
                        'oi_user',
                        'oi_user_text',
-                       'oi_actor' => $wgActorTableSchemaMigrationStage > MIGRATION_OLD ? 'oi_actor' : null,
+                       'oi_actor' => $wgActorTableSchemaMigrationStage > MIGRATION_OLD ? 'oi_actor' : 'NULL',
                        'oi_timestamp',
                        'oi_deleted',
                        'oi_sha1',
-               ] + CommentStore::getStore()->getFields( 'oi_description' );
+               ] + MediaWikiServices::getInstance()->getCommentStore()->getFields( 'oi_description' );
        }
 
        /**
@@ -155,7 +157,7 @@ class OldLocalFile extends LocalFile {
         *   - joins: (array) to include in the `$join_conds` to `IDatabase->select()`
         */
        public static function getQueryInfo( array $options = [] ) {
-               $commentQuery = CommentStore::getStore()->getJoin( 'oi_description' );
+               $commentQuery = MediaWikiServices::getInstance()->getCommentStore()->getJoin( 'oi_description' );
                $actorQuery = ActorMigration::newMigration()->getJoin( 'oi_user' );
                $ret = [
                        'tables' => [ 'oldimage' ] + $commentQuery['tables'] + $actorQuery['tables'],
@@ -446,7 +448,8 @@ class OldLocalFile extends LocalFile {
                        return false;
                }
 
-               $commentFields = CommentStore::getStore()->insert( $dbw, 'oi_description', $comment );
+               $commentFields = MediaWikiServices::getInstance()->getCommentStore()
+                       ->insert( $dbw, 'oi_description', $comment );
                $actorFields = ActorMigration::newMigration()->getInsertValues( $dbw, 'oi_user', $user );
                $dbw->insert( 'oldimage',
                        [