X-Git-Url: https://git.cyclocoop.org/admin/?a=blobdiff_plain;f=includes%2Fpage%2FPageArchive.php;h=8b42020af2309542cf105f5eb31810e24b411a11;hb=21c6ae1163b07da7ac49938f50613c0e1cf262c3;hp=05247cafebb09e25090cb5f0e1fcc6a8a528ccd2;hpb=1a9ba829a5fbf40c0c2835efd441aaa70f9c319b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/page/PageArchive.php b/includes/page/PageArchive.php index 05247cafeb..8b42020af2 100644 --- a/includes/page/PageArchive.php +++ b/includes/page/PageArchive.php @@ -315,19 +315,13 @@ class PageArchive { } /** - * Get the text from an archive row containing ar_text, ar_flags and ar_text_id + * Get the text from an archive row containing ar_text_id * + * @deprecated since 1.31 * @param object $row Database row * @return string */ public function getTextFromRow( $row ) { - if ( is_null( $row->ar_text_id ) ) { - // An old row from MediaWiki 1.4 or previous. - // Text is embedded in this row in classic compression format. - return Revision::getRevisionText( $row, 'ar_' ); - } - - // New-style: keyed to the text storage backend. $dbr = wfGetDB( DB_REPLICA ); $text = $dbr->selectRow( 'text', [ 'old_text', 'old_flags' ], @@ -347,15 +341,18 @@ class PageArchive { */ public function getLastRevisionText() { $dbr = wfGetDB( DB_REPLICA ); - $row = $dbr->selectRow( 'archive', - [ 'ar_text', 'ar_flags', 'ar_text_id' ], + $row = $dbr->selectRow( + [ 'archive', 'text' ], + [ 'old_text', 'old_flags' ], [ 'ar_namespace' => $this->title->getNamespace(), 'ar_title' => $this->title->getDBkey() ], __METHOD__, - [ 'ORDER BY' => 'ar_timestamp DESC' ] ); + [ 'ORDER BY' => 'ar_timestamp DESC, ar_id DESC' ], + [ 'text' => [ 'JOIN', 'old_id = ar_text_id' ] ] + ); if ( $row ) { - return $this->getTextFromRow( $row ); + return Revision::getRevisionText( $row ); } return null;