From: umherirrender Date: Fri, 8 Jun 2012 12:24:39 +0000 (+0200) Subject: Add call to GenderCache in list=allpages X-Git-Tag: 1.31.0-rc.0~23047^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=commitdiff_plain;h=8e5c1bc69f24a0a525ad8edc36c1f4daad65264d;p=lhc%2Fweb%2Fwiklou.git Add call to GenderCache in list=allpages Without this call, each user page can produce a query to get the gender state. Change-Id: I430c9922008cfea57b02da112087a7d52aeb4d23 --- diff --git a/includes/api/ApiQueryAllPages.php b/includes/api/ApiQueryAllPages.php index cfc22ff9f1..dec3d8a484 100644 --- a/includes/api/ApiQueryAllPages.php +++ b/includes/api/ApiQueryAllPages.php @@ -165,6 +165,16 @@ class ApiQueryAllPages extends ApiQueryGeneratorBase { $this->addOption( 'LIMIT', $limit + 1 ); $res = $this->select( __METHOD__ ); + //Get gender information + if( MWNamespace::hasGenderDistinction( $params['namespace'] ) ) { + $users = array(); + foreach ( $res as $row ) { + $users[] = $row->page_title; + } + GenderCache::singleton()->doQuery( $users, __METHOD__ ); + $res->rewind(); //reset + } + $count = 0; $result = $this->getResult(); foreach ( $res as $row ) {