From 77884372c011d91bc2f24ee4ef68b5a93dc35edb Mon Sep 17 00:00:00 2001 From: Matthew Flaschen Date: Thu, 19 May 2016 17:10:35 -0400 Subject: [PATCH] RevDel: Fix ChangeTags for archived items Bug: T128980 Change-Id: Ibc9ec57da16e1b71c9efa0d2c062f8d7965f59bc --- includes/revisiondelete/RevDelArchiveList.php | 35 ++++++++++++++----- .../revisiondelete/RevDelRevisionList.php | 30 +++++++++++++--- 2 files changed, 51 insertions(+), 14 deletions(-) diff --git a/includes/revisiondelete/RevDelArchiveList.php b/includes/revisiondelete/RevDelArchiveList.php index 9bb1dc5011..72c460e0db 100644 --- a/includes/revisiondelete/RevDelArchiveList.php +++ b/includes/revisiondelete/RevDelArchiveList.php @@ -41,15 +41,32 @@ class RevDelArchiveList extends RevDelRevisionList { $timestamps[] = $db->timestamp( $id ); } - return $db->select( 'archive', Revision::selectArchiveFields(), - [ - 'ar_namespace' => $this->title->getNamespace(), - 'ar_title' => $this->title->getDBkey(), - 'ar_timestamp' => $timestamps - ], - __METHOD__, - [ 'ORDER BY' => 'ar_timestamp DESC' ] - ); + $tables = [ 'archive' ]; + $fields = Revision::selectArchiveFields(); + $conds = [ + 'ar_namespace' => $this->title->getNamespace(), + 'ar_title' => $this->title->getDBkey(), + 'ar_timestamp' => $timestamps, + ]; + $join_conds = []; + $options = [ 'ORDER BY' => 'ar_timestamp DESC' ]; + + ChangeTags::modifyDisplayQuery( + $tables, + $fields, + $conds, + $join_conds, + $options, + '' + ); + + return $db->select( $tables, + $fields, + $conds, + __METHOD__, + $options, + $join_conds + ); } public function newItem( $row ) { diff --git a/includes/revisiondelete/RevDelRevisionList.php b/includes/revisiondelete/RevDelRevisionList.php index bc2b2e9022..27e5148611 100644 --- a/includes/revisiondelete/RevDelRevisionList.php +++ b/includes/revisiondelete/RevDelRevisionList.php @@ -94,13 +94,33 @@ class RevDelRevisionList extends RevDelList { return $live; } - // Check if any requested revisions are available fully deleted. - $archived = $db->select( [ 'archive' ], Revision::selectArchiveFields(), - [ - 'ar_rev_id' => $ids + $archiveQueryInfo = [ + 'tables' => [ 'archive' ], + 'fields' => Revision::selectArchiveFields(), + 'conds' => [ + 'ar_rev_id' => $ids, ], + 'options' => [ 'ORDER BY' => 'ar_rev_id DESC' ], + 'join_conds' => [], + ]; + + ChangeTags::modifyDisplayQuery( + $archiveQueryInfo['tables'], + $archiveQueryInfo['fields'], + $archiveQueryInfo['conds'], + $archiveQueryInfo['join_conds'], + $archiveQueryInfo['options'], + '' + ); + + // Check if any requested revisions are available fully deleted. + $archived = $db->select( + $archiveQueryInfo['tables'], + $archiveQueryInfo['fields'], + $archiveQueryInfo['conds'], __METHOD__, - [ 'ORDER BY' => 'ar_rev_id DESC' ] + $archiveQueryInfo['options'], + $archiveQueryInfo['join_conds'] ); if ( $archived->numRows() == 0 ) { -- 2.20.1