Fix use of GenderCache in ApiPageSet::processTitlesArray
authorUmherirrender <umherirrender_de.wp@web.de>
Sat, 22 Sep 2018 09:31:02 +0000 (11:31 +0200)
committerAnomie <bjorsch@wikimedia.org>
Mon, 9 Sep 2019 19:54:07 +0000 (19:54 +0000)
commit91fd689add2a4067d3e306fd0a5a2d8a6ffaff1b
treed0c57c500031c48ee148e8e1ecaa4a64a3b71335
parent75f1fe04a8006df7b8716c4b966b1725d5d4bea1
Fix use of GenderCache in ApiPageSet::processTitlesArray

Title::getPrefixedText was called before the GenderCache was set up,
which lazy loads the cache for each title,
resulting in one query per user title

Splitted the foreach to fill the cache at a better location

Added a test for ApiPageSet to test that the gender cache is filled

Bug: T200238
Change-Id: I7972dd1bf3731a92328caab20e70d7b9b82c1f7c
includes/api/ApiPageSet.php
tests/phpunit/includes/api/ApiPageSetTest.php