X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryContributors.php;h=9057f1055b6ee6952aeae9cf2fd10cd9d9bdf3be;hb=1e4bf35253a6f672c57c1430c895049591fb090b;hp=85f3e4bd2b4aff06dba6d8711d3834bbcfc94117;hpb=9d1b8a59d14b01fe83bb9a078ef4936f9a40ef7d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryContributors.php b/includes/api/ApiQueryContributors.php index 85f3e4bd2b..9057f1055b 100644 --- a/includes/api/ApiQueryContributors.php +++ b/includes/api/ApiQueryContributors.php @@ -64,7 +64,7 @@ class ApiQueryContributors extends ApiQueryBase { return $v >= $cont_page; } ); } - if ( !count( $pages ) ) { + if ( $pages === [] ) { // Nothing to do return; } @@ -80,12 +80,13 @@ class ApiQueryContributors extends ApiQueryBase { $result = $this->getResult(); $revQuery = MediaWikiServices::getInstance()->getRevisionStore()->getQueryInfo(); - // For MIGRATION_NEW, target indexes on the revision_actor_temp table. - // Otherwise, revision is fine because it'll have to check all revision rows anyway. - $pageField = $wgActorTableSchemaMigrationStage === MIGRATION_NEW ? 'revactor_page' : 'rev_page'; - $idField = $wgActorTableSchemaMigrationStage === MIGRATION_NEW + // For SCHEMA_COMPAT_READ_NEW, target indexes on the + // revision_actor_temp table, otherwise on the revision table. + $pageField = ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_READ_NEW ) + ? 'revactor_page' : 'rev_page'; + $idField = ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_READ_NEW ) ? 'revactor_actor' : $revQuery['fields']['rev_user']; - $countField = $wgActorTableSchemaMigrationStage === MIGRATION_NEW + $countField = ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_READ_NEW ) ? 'revactor_actor' : $revQuery['fields']['rev_user_text']; // First, count anons @@ -175,7 +176,7 @@ class ApiQueryContributors extends ApiQueryBase { $limitGroups = array_unique( $limitGroups ); $this->addTables( 'user_groups' ); $this->addJoinConds( [ 'user_groups' => [ - $excludeGroups ? 'LEFT OUTER JOIN' : 'INNER JOIN', + $excludeGroups ? 'LEFT JOIN' : 'JOIN', [ 'ug_user=' . $revQuery['fields']['rev_user'], 'ug_group' => $limitGroups,