Merge "Optimize JobQueue utilization in UserGroupMembership::insert()"
[lhc/web/wiklou.git] / includes / api / ApiQueryAllDeletedRevisions.php
index bb50185..85ca648 100644 (file)
@@ -49,7 +49,8 @@ class ApiQueryAllDeletedRevisions extends ApiQueryRevisionsBase {
                $user = $this->getUser();
                $db = $this->getDB();
                $params = $this->extractRequestParams( false );
-               $revisionStore = MediaWikiServices::getInstance()->getRevisionStore();
+               $services = MediaWikiServices::getInstance();
+               $revisionStore = $services->getRevisionStore();
 
                $result = $this->getResult();
 
@@ -142,21 +143,16 @@ class ApiQueryAllDeletedRevisions extends ApiQueryRevisionsBase {
                        }
                }
 
+               // This means stricter restrictions
                if ( $this->fetchContent ) {
-                       $this->addTables( 'text' );
-                       $this->addJoinConds(
-                               [ 'text' => [ 'LEFT JOIN', [ 'ar_text_id=old_id' ] ] ]
-                       );
-                       $this->addFields( [ 'old_text', 'old_flags' ] );
-
-                       // This also means stricter restrictions
                        $this->checkUserRightsAny( [ 'deletedtext', 'undelete' ] );
                }
 
                $miser_ns = null;
 
                if ( $mode == 'all' ) {
-                       $namespaces = $params['namespace'] ?? MWNamespace::getValidNamespaces();
+                       $namespaces = $params['namespace'] ??
+                               $services->getNamespaceInfo()->getValidNamespaces();
                        $this->addWhereFld( 'ar_namespace', $namespaces );
 
                        // For from/to/prefix, we have to consider the potential