RevDel: Fix ChangeTags for archived items
authorMatthew Flaschen <mflaschen@wikimedia.org>
Thu, 19 May 2016 21:10:35 +0000 (17:10 -0400)
committerUmherirrender <umherirrender_de.wp@web.de>
Tue, 24 May 2016 18:33:25 +0000 (18:33 +0000)
Bug: T128980
Change-Id: Ibc9ec57da16e1b71c9efa0d2c062f8d7965f59bc

includes/revisiondelete/RevDelArchiveList.php
includes/revisiondelete/RevDelRevisionList.php

index 9bb1dc5..72c460e 100644 (file)
@@ -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 ) {
index bc2b2e9..27e5148 100644 (file)
@@ -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 ) {