X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryUserContributions.php;h=b85bec4899c53c81b3f399dbe5e6724d6094f265;hb=d6dcf23a8f22245e311d5582e4f9cd0f302e3738;hp=51e192325e7ed96caf3b2be00a02ca72204381f5;hpb=d8682d1415572b3d67f31cddab2ceb4d6661565b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryUserContributions.php b/includes/api/ApiQueryUserContributions.php index 51e192325e..b85bec4899 100644 --- a/includes/api/ApiQueryUserContributions.php +++ b/includes/api/ApiQueryUserContributions.php @@ -57,13 +57,13 @@ class ApiQueryContributions extends ApiQueryBase { $this->fld_patrolled = isset( $prop['patrolled'] ); $this->fld_tags = isset( $prop['tags'] ); - // Most of this code will use the 'contributions' group DB, which can map to slaves + // Most of this code will use the 'contributions' group DB, which can map to replica DBs // with extra user based indexes or partioning by user. The additional metadata - // queries should use a regular slave since the lookup pattern is not all by user. - $dbSecondary = $this->getDB(); // any random slave + // queries should use a regular replica DB since the lookup pattern is not all by user. + $dbSecondary = $this->getDB(); // any random replica DB // TODO: if the query is going only against the revision table, should this be done? - $this->selectNamedDB( 'contributions', DB_SLAVE, 'contributions' ); + $this->selectNamedDB( 'contributions', DB_REPLICA, 'contributions' ); $this->idMode = false; if ( isset( $this->params['userprefix'] ) ) { @@ -111,8 +111,9 @@ class ApiQueryContributions extends ApiQueryBase { $this->prepareQuery(); + $hookData = []; // Do the actual query. - $res = $this->select( __METHOD__ ); + $res = $this->select( __METHOD__, [], $hookData ); if ( $this->fld_sizediff ) { $revIds = []; @@ -139,7 +140,8 @@ class ApiQueryContributions extends ApiQueryBase { } $vals = $this->extractRowInfo( $row ); - $fit = $this->getResult()->addValue( [ 'query', $this->getModuleName() ], null, $vals ); + $fit = $this->processRow( $row, $vals, $hookData ) && + $this->getResult()->addValue( [ 'query', $this->getModuleName() ], null, $vals ); if ( !$fit ) { $this->setContinueEnumParameter( 'continue', $this->continueStr( $row ) ); break;