From: umherirrender Date: Wed, 16 May 2012 14:38:40 +0000 (+0200) Subject: prop=revisions: join user table to get user name X-Git-Tag: 1.31.0-rc.0~23593^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/bilan.php?a=commitdiff_plain;h=a5e50e8b2fab163bc74a31b8252f18db1a927fbb;p=lhc%2Fweb%2Fwiklou.git prop=revisions: join user table to get user name this avoid a lazy load of the user name for each row Change-Id: I5d8983476e03cc2f6dad074577402f5255080838 --- diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index 7390546492..426de6c0f3 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -224,6 +224,13 @@ class ApiQueryRevisions extends ApiQueryBase { } } + // add user name, if needed + if ( $this->fld_user ) { + $this->addTables( 'user' ); + $this->addJoinConds( array( 'user' => Revision::userJoinCond() ) ); + $this->addFields( Revision::selectUserFields() ); + } + // Bug 24166 - API error when using rvprop=tags $this->addTables( 'revision' );