aboutsummaryrefslogtreecommitdiffstats
path: root/includes/api/ApiQueryBase.php
diff options
context:
space:
mode:
authorUmherirrender <umherirrender_de.wp@web.de>2019-10-10 19:44:04 +0200
committerUmherirrender <umherirrender_de.wp@web.de>2019-11-02 22:23:23 +0100
commit731d9f748ee865020e5396128491faf16686526a (patch)
tree8969a0cb5a7fb7b5699082d61fefe00becaf4f3a /includes/api/ApiQueryBase.php
parent650868fa48dd8da6b87677db56ea18f92eae8647 (diff)
downloadmediawikicore-731d9f748ee865020e5396128491faf16686526a.tar.gz
mediawikicore-731d9f748ee865020e5396128491faf16686526a.zip
Run GenderCache for api query modules using ApiQueryBase::addTitleInfo
When converting a Title object into a string for user or user talk namespace the gender information are needed. This patch set improves performance on wikis with gender distinction like dewiki or ruwiki by combining the fetch of the information into one query and avoids a query per unique user name. It also avoids false results for request with apihighlimit, because the apihighlimit with 5000 is higher than the query max limit of the GenderCache with 1000 Bug: T200238 Change-Id: Ibe0561b210dbeb654117dad777e839640f51b4e4
Diffstat (limited to 'includes/api/ApiQueryBase.php')
-rw-r--r--includes/api/ApiQueryBase.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php
index 059c438a37ea..3ab0084d2ff0 100644
--- a/includes/api/ApiQueryBase.php
+++ b/includes/api/ApiQueryBase.php
@@ -587,6 +587,10 @@ abstract class ApiQueryBase extends ApiBase {
}
$services = MediaWikiServices::getInstance();
+ if ( !$services->getContentLanguage()->needsGenderDistinction() ) {
+ return;
+ }
+
$nsInfo = $services->getNamespaceInfo();
$namespaceField = $fieldPrefix . '_namespace';
$titleField = $fieldPrefix . '_title';