WMDE-leszek has uploaded a new change for review.
https://gerrit.wikimedia.org/r/277788
Change subject: Fix ApiQueryInfo response for prop=watchers
......................................................................
Fix ApiQueryInfo response for prop=watchers
Ie84e6feaa42db1bc7a1f89b56aed37dd7fe95ea4 part of them problem
with incorrect API response but if when no watchers data is
fetched (ie. due to early return in ApiQueryInfo::getWatcherInfo),
response contains "watchers": null instead of skipping "watchers"
key entirely.
Bug: T129482
Change-Id: I9cab120ec4e6a9cf4626678e45ef14ea8efc8cbc
---
M includes/api/ApiQueryInfo.php
1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/88/277788/1
diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php
index 3aa0122..f33da1e 100644
--- a/includes/api/ApiQueryInfo.php
+++ b/includes/api/ApiQueryInfo.php
@@ -453,8 +453,10 @@
}
if ( $this->fld_watchers ) {
- if ( $this->watchers[$ns][$dbkey] !== 0 ||
$this->showZeroWatchers ) {
+ if ( $this->watchers !== null &&
$this->watchers[$ns][$dbkey] !== 0 ) {
$pageInfo['watchers'] =
$this->watchers[$ns][$dbkey];
+ } elseif ( $this->showZeroWatchers ) {
+ $pageInfo['watchers'] = 0;
}
}
--
To view, visit https://gerrit.wikimedia.org/r/277788
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9cab120ec4e6a9cf4626678e45ef14ea8efc8cbc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: WMDE-leszek <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits