X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Ffilerepo%2Ffile%2FArchivedFile.php;h=758fb4b5a11f6087267b9ca5a8b59be6f19cb6f9;hb=41690888a2919b3fb89c715c364d21d8965c8b26;hp=6984d48c6d8b030286eec83511e35232c5fe87ce;hpb=dae4c94d893057345f62a3d498fb85c0a54de5a6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filerepo/file/ArchivedFile.php b/includes/filerepo/file/ArchivedFile.php index 6984d48c6d..758fb4b5a1 100644 --- a/includes/filerepo/file/ArchivedFile.php +++ b/includes/filerepo/file/ArchivedFile.php @@ -215,6 +215,8 @@ class ArchivedFile { /** * Fields in the filearchive table + * @todo Deprecate this in favor of a method that returns tables and joins + * as well, and use CommentStore::getJoin(). * @return array */ static function selectFields() { @@ -232,14 +234,13 @@ class ArchivedFile { 'fa_media_type', 'fa_major_mime', 'fa_minor_mime', - 'fa_description', 'fa_user', 'fa_user_text', 'fa_timestamp', 'fa_deleted', 'fa_deleted_timestamp', /* Used by LocalFileRestoreBatch */ 'fa_sha1', - ]; + ] + CommentStore::newKey( 'fa_description' )->getFields(); } /** @@ -261,7 +262,9 @@ class ArchivedFile { $this->metadata = $row->fa_metadata; $this->mime = "$row->fa_major_mime/$row->fa_minor_mime"; $this->media_type = $row->fa_media_type; - $this->description = $row->fa_description; + $this->description = CommentStore::newKey( 'fa_description' ) + // Legacy because $row probably came from self::selectFields() + ->getCommentLegacy( wfGetDB( DB_REPLICA ), $row )->text; $this->user = $row->fa_user; $this->user_text = $row->fa_user_text; $this->timestamp = $row->fa_timestamp;