From: addshore Date: Tue, 15 Mar 2016 16:08:45 +0000 (+0000) Subject: Fix ApiQueryInfo break from use of WatchedItemStore X-Git-Tag: 1.31.0-rc.0~7611 X-Git-Url: https://git.cyclocoop.org//%22?a=commitdiff_plain;h=2bfdb5da848be0a2286fadab6d372e17837e40ee;p=lhc%2Fweb%2Fwiklou.git Fix ApiQueryInfo break from use of WatchedItemStore Fixes an issue introduced in: I5a465773599cce9f8c9e94847cede6d12282c827 The new code now returns all targets even when 0 watcher have been found. This patch adjusts the api to expect that. Bug: T129482 Change-Id: Ie84e6feaa42db1bc7a1f89b56aed37dd7fe95ea4 --- diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index a3c98ed5e2..3aa0122d7d 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -453,10 +453,8 @@ class ApiQueryInfo extends ApiQueryBase { } if ( $this->fld_watchers ) { - if ( isset( $this->watchers[$ns][$dbkey] ) ) { + if ( $this->watchers[$ns][$dbkey] !== 0 || $this->showZeroWatchers ) { $pageInfo['watchers'] = $this->watchers[$ns][$dbkey]; - } elseif ( $this->showZeroWatchers ) { - $pageInfo['watchers'] = 0; } }