jenkins-bot has submitted this change and it was merged.
Change subject: Return listpages results in query object
......................................................................
Return listpages results in query object
All tests pass and api use already expects pages to be wrapped
in query object.
bug: T94124
Change-Id: I41cd540c3faa4de0be3da5e619c0f9c9cdeb2b05
---
M includes/api/ApiQueryListPages.php
M tests/phpunit/api/GatherTests.php
2 files changed, 7 insertions(+), 5 deletions(-)
Approvals:
Yurik: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/api/ApiQueryListPages.php
b/includes/api/ApiQueryListPages.php
index 767c031..197c6b0 100644
--- a/includes/api/ApiQueryListPages.php
+++ b/includes/api/ApiQueryListPages.php
@@ -41,8 +41,11 @@
*/
class ApiQueryListPages extends ApiQueryGeneratorBase {
+ private $modulePath;
+
public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'lsp' );
+ $this->modulePath = array( 'query', $this->getModuleName() );
}
public function execute() {
@@ -114,9 +117,8 @@
$titles = $this->queryListItems( $params,
$isGenerator );
}
}
-
if ( !$isGenerator ) {
- $this->getResult()->setIndexedTagName_internal(
$this->getModuleName(), 'wr' );
+ $this->getResult()->setIndexedTagName_internal(
$this->modulePath, 'wr' );
} else {
$resultPageSet->populateFromTitles( $titles );
}
@@ -159,7 +161,7 @@
if ( !$isGenerator ) {
$vals = array();
ApiQueryBase::addTitleInfo( $vals, $t );
- $fit = $this->getResult()->addValue(
$this->getModuleName(), null, $vals );
+ $fit = $this->getResult()->addValue(
$this->modulePath, null, $vals );
if ( !$fit ) {
$this->setContinueEnumParameter(
'continue', $row->gli_order );
break;
@@ -225,7 +227,7 @@
if ( !$isGenerator ) {
$vals = array();
ApiQueryBase::addTitleInfo( $vals, $t );
- $fit = $this->getResult()->addValue(
$this->getModuleName(), null, $vals );
+ $fit = $this->getResult()->addValue(
$this->modulePath, null, $vals );
if ( !$fit ) {
$this->setContinueEnumParameter(
'continue', $row->wl_namespace . '|' . $row->wl_title );
break;
diff --git a/tests/phpunit/api/GatherTests.php
b/tests/phpunit/api/GatherTests.php
index 4ac4fbc..c403dbe 100644
--- a/tests/phpunit/api/GatherTests.php
+++ b/tests/phpunit/api/GatherTests.php
@@ -1056,6 +1056,6 @@
private function assertPages( $message, $u, $id, $expected ) {
$params = $id === null ? '{}' : '"lspid":' . $id;
$res = $this->getPages( $message, $u, $params );
- $this->getVal( $message, '"listpages"', $res, $expected );
+ $this->getVal( $message, '"query", "listpages"', $res,
$expected );
}
}
--
To view, visit https://gerrit.wikimedia.org/r/203461
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I41cd540c3faa4de0be3da5e619c0f9c9cdeb2b05
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Gather
Gerrit-Branch: master
Gerrit-Owner: Robmoen <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Yurik <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits