From 397dfd13f7856771297408526f66367b9d135b8e Mon Sep 17 00:00:00 2001 From: addshore Date: Thu, 14 Apr 2016 09:15:18 +0100 Subject: [PATCH] Use WatchedItemStore for SP:RC watchers count Bug: T132568 Change-Id: Ic6a0ee77cb767c6f8e4a8d359feb0405c9a990d1 --- includes/specials/SpecialRecentchanges.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index de773800ac..8398989488 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -344,14 +344,8 @@ class SpecialRecentChanges extends ChangesListSpecialPage { if ( $showWatcherCount && $obj->rc_namespace >= 0 ) { if ( !isset( $watcherCache[$obj->rc_namespace][$obj->rc_title] ) ) { $watcherCache[$obj->rc_namespace][$obj->rc_title] = - $dbr->selectField( - 'watchlist', - 'COUNT(*)', - [ - 'wl_namespace' => $obj->rc_namespace, - 'wl_title' => $obj->rc_title, - ], - __METHOD__ . '-watchers' + WatchedItemStore::getDefaultInstance()->countWatchers( + new TitleValue( (int)$obj->rc_namespace, $obj->rc_title ) ); } $rc->numberofWatchingusers = $watcherCache[$obj->rc_namespace][$obj->rc_title]; -- 2.20.1