diff options
author | Amir Sarabadani <ladsgroup@gmail.com> | 2023-08-28 10:52:19 +0200 |
---|---|---|
committer | Amir Sarabadani <ladsgroup@gmail.com> | 2023-09-06 12:30:38 +0200 |
commit | 049b34b41ce07e12bb5da574cbfefdbb26e6a2ed (patch) | |
tree | 3c7b164461eaf24ed1c524dffbb7aa7bc60188ad /includes/api/ApiQueryRevisions.php | |
parent | 53858466f1128a9195bd2b3599c2b4a994652105 (diff) | |
download | mediawikicore-049b34b41ce07e12bb5da574cbfefdbb26e6a2ed.tar.gz mediawikicore-049b34b41ce07e12bb5da574cbfefdbb26e6a2ed.zip |
Introduce RevisionSelectQueryBuilder
Deprecating RevisionStore::getQueryInfo() and cleaning up a lot of code
Also removing a brittle test that wasn't really testing anything.
Bug: T344971
Change-Id: Ifd690dc8f030f86e3567a717eaeb830cb6dc703b
Diffstat (limited to 'includes/api/ApiQueryRevisions.php')
-rw-r--r-- | includes/api/ApiQueryRevisions.php | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index 830baaf16347..97c450a52395 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -160,14 +160,13 @@ class ApiQueryRevisions extends ApiQueryRevisionsBase { $useIndex = []; if ( $resultPageSet === null ) { $this->parseParameters( $params ); - $opts = [ 'page' ]; + $queryBuilder = $this->revisionStore->newSelectQueryBuilder( $db ) + ->joinComment() + ->joinPage(); if ( $this->fld_user ) { - $opts[] = 'user'; + $queryBuilder->joinUser(); } - $revQuery = $this->revisionStore->getQueryInfo( $opts ); - $this->addTables( $revQuery['tables'] ); - $this->addFields( $revQuery['fields'] ); - $this->addJoinConds( $revQuery['joins'] ); + $this->getQueryBuilder()->merge( $queryBuilder ); } else { $this->limit = $this->getParameter( 'limit' ) ?: 10; // Always join 'page' so orphaned revisions are filtered out |