X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryAllRevisions.php;h=c8db6a1189bbc1b90441a03515b5164511772b04;hb=ea8961d7ee57c68f57f5df27876bb04a96f5ff84;hp=8f7d6eb28f0a28bbe90086a30071c5694256f486;hpb=942446575486057b38e186a8f5599a645758b702;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryAllRevisions.php b/includes/api/ApiQueryAllRevisions.php index 8f7d6eb28f..c8db6a1189 100644 --- a/includes/api/ApiQueryAllRevisions.php +++ b/includes/api/ApiQueryAllRevisions.php @@ -63,20 +63,20 @@ class ApiQueryAllRevisions extends ApiQueryRevisionsBase { } } - $this->addTables( 'revision' ); if ( $resultPageSet === null ) { $this->parseParameters( $params ); - $this->addTables( 'page' ); - $this->addJoinConds( - [ 'page' => [ 'INNER JOIN', [ 'rev_page = page_id' ] ] ] + $revQuery = Revision::getQueryInfo( + $this->fetchContent ? [ 'page', 'text' ] : [ 'page' ] ); - $this->addFields( Revision::selectFields() ); - $this->addFields( Revision::selectPageFields() ); + $this->addTables( $revQuery['tables'] ); + $this->addFields( $revQuery['fields'] ); + $this->addJoinConds( $revQuery['joins'] ); // Review this depeneding on the outcome of T113901 $this->addOption( 'STRAIGHT_JOIN' ); } else { $this->limit = $this->getParameter( 'limit' ) ?: 10; + $this->addTables( 'revision' ); $this->addFields( [ 'rev_timestamp', 'rev_id' ] ); if ( $params['generatetitles'] ) { $this->addFields( [ 'rev_page' ] ); @@ -105,15 +105,6 @@ class ApiQueryAllRevisions extends ApiQueryRevisionsBase { $this->addFields( 'ts_tags' ); } - if ( $this->fetchContent ) { - $this->addTables( 'text' ); - $this->addJoinConds( - [ 'text' => [ 'INNER JOIN', [ 'rev_text_id=old_id' ] ] ] - ); - $this->addFields( 'old_id' ); - $this->addFields( Revision::selectTextFields() ); - } - if ( $params['user'] !== null ) { $id = User::idFromName( $params['user'] ); if ( $id ) {