X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryContributors.php;h=642c9ac3e56a1e08e39ef4b9bfa6a88726bb369a;hb=d4cc4f2b4f20725725a9345c7a4b7906e5aa66d2;hp=e39afac6cf028392a82cc7832083af82c079ca33;hpb=62fa503bc36330c7db64f1511e0f61affa3afb86;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryContributors.php b/includes/api/ApiQueryContributors.php index e39afac6cf..642c9ac3e5 100644 --- a/includes/api/ApiQueryContributors.php +++ b/includes/api/ApiQueryContributors.php @@ -24,7 +24,7 @@ */ use MediaWiki\MediaWikiServices; -use MediaWiki\Storage\RevisionRecord; +use MediaWiki\Revision\RevisionRecord; /** * A query module to show contributors to a page @@ -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