Revert "[MCR] Turn Revision into a proxy to new code."
[lhc/web/wiklou.git] / includes / actions / HistoryAction.php
index a9a504d..0e964bf 100644 (file)
@@ -154,7 +154,7 @@ class HistoryAction extends FormlessAction {
                        # show deletion/move log if there is an entry
                        LogEventsList::showLogExtract(
                                $out,
-                               [ 'delete', 'move' ],
+                               [ 'delete', 'move', 'protect' ],
                                $this->getTitle(),
                                '',
                                [ 'lim' => 10,
@@ -258,12 +258,18 @@ class HistoryAction extends FormlessAction {
 
                $page_id = $this->page->getId();
 
-               return $dbr->select( 'revision',
-                       Revision::selectFields(),
+               $revQuery = Revision::getQueryInfo();
+               return $dbr->select(
+                       $revQuery['tables'],
+                       $revQuery['fields'],
                        array_merge( [ 'rev_page' => $page_id ], $offsets ),
                        __METHOD__,
-                       [ 'ORDER BY' => "rev_timestamp $dirs",
-                               'USE INDEX' => 'page_timestamp', 'LIMIT' => $limit ]
+                       [
+                               'ORDER BY' => "rev_timestamp $dirs",
+                               'USE INDEX' => [ 'revision' => 'page_timestamp' ],
+                               'LIMIT' => $limit
+                       ],
+                       $revQuery['joins']
                );
        }
 
@@ -418,14 +424,15 @@ class HistoryPager extends ReverseChronologicalPager {
        }
 
        function getQueryInfo() {
+               $revQuery = Revision::getQueryInfo( [ 'user' ] );
                $queryInfo = [
-                       'tables' => [ 'revision', 'user' ],
-                       'fields' => array_merge( Revision::selectFields(), Revision::selectUserFields() ),
+                       'tables' => $revQuery['tables'],
+                       'fields' => $revQuery['fields'],
                        'conds' => array_merge(
                                [ 'rev_page' => $this->getWikiPage()->getId() ],
                                $this->conds ),
                        'options' => [ 'USE INDEX' => [ 'revision' => 'page_timestamp' ] ],
-                       'join_conds' => [ 'user' => Revision::userJoinCond() ],
+                       'join_conds' => $revQuery['joins'],
                ];
                ChangeTags::modifyDisplayQuery(
                        $queryInfo['tables'],