Use CommentStore::getCommentLegacy with CommentStore::getFields
authorBrad Jorsch <bjorsch@wikimedia.org>
Mon, 11 Sep 2017 14:33:29 +0000 (10:33 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Mon, 11 Sep 2017 14:33:29 +0000 (10:33 -0400)
It doesn't matter when $wgCommentTableSchemaMigrationStage is
MIGRATION_OLD, but it'll fail when we start changing that to later
migration stages.

Follows up I3447a412.

Change-Id: I6c010cefedd99324080ec078b83159d12709c1b1

includes/filerepo/file/LocalFile.php

index 6d003d6..8aea7ab 100644 (file)
@@ -538,7 +538,8 @@ class LocalFile extends File {
                $this->extraDataLoaded = true;
 
                $this->description = CommentStore::newKey( "{$prefix}description" )
-                       ->getComment( $row )->text;
+                       // $row is probably using getFields() from self::getCacheFields()
+                       ->getCommentLegacy( wfGetDB( DB_REPLICA ), $row )->text;
 
                $array = $this->decodeRow( $row, $prefix );