Merge "Message: Don't include Title objects in the serialization (part 2)"
[lhc/web/wiklou.git] / includes / revisiondelete / RevDelArchiveList.php
index e7aed73..4f66cda 100644 (file)
@@ -19,6 +19,8 @@
  * @ingroup RevisionDelete
  */
 
+use Wikimedia\Rdbms\IDatabase;
+
 /**
  * List for archive table items, i.e. revisions deleted via action=delete
  */
@@ -32,24 +34,42 @@ class RevDelArchiveList extends RevDelRevisionList {
        }
 
        /**
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         * @return mixed
         */
        public function doQuery( $db ) {
-               $timestamps = array();
+               $timestamps = [];
                foreach ( $this->ids as $id ) {
                        $timestamps[] = $db->timestamp( $id );
                }
 
-               return $db->select( 'archive', Revision::selectArchiveFields(),
-                               array(
-                                       'ar_namespace' => $this->title->getNamespace(),
-                                       'ar_title' => $this->title->getDBkey(),
-                                       'ar_timestamp' => $timestamps
-                               ),
-                               __METHOD__,
-                               array( 'ORDER BY' => 'ar_timestamp DESC' )
-                       );
+               $arQuery = Revision::getArchiveQueryInfo();
+               $tables = $arQuery['tables'];
+               $fields = $arQuery['fields'];
+               $conds = [
+                       'ar_namespace' => $this->title->getNamespace(),
+                       'ar_title' => $this->title->getDBkey(),
+                       'ar_timestamp' => $timestamps,
+               ];
+               $join_conds = $arQuery['joins'];
+               $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 ) {
@@ -60,7 +80,7 @@ class RevDelArchiveList extends RevDelRevisionList {
                return Status::newGood();
        }
 
-       public function doPostCommitUpdates() {
+       public function doPostCommitUpdates( array $visibilityChangeMap ) {
                return Status::newGood();
        }
 }