diff --git a/includes/WatchAnalyticsPageTablePager.php b/includes/WatchAnalyticsPageTablePager.php index a06b355..a0f2d95 100644 --- a/includes/WatchAnalyticsPageTablePager.php +++ b/includes/WatchAnalyticsPageTablePager.php @@ -30,7 +30,7 @@ public function __construct( $page, $conds, $filters = [] ) { } public function getQueryInfo() { - $namespaces = MWNamespace::getCanonicalNamespaces(); + $namespaces = MediaWikiServices::getInstance()->getNamespaceInfo()->getCanonicalNamespaces(); if ( $this->mQueryNamespace !== null && $this->mQueryNamespace >= 0 diff --git a/includes/WatchAnalyticsParserFunctions.php b/includes/WatchAnalyticsParserFunctions.php index 881267c..b073dcf 100644 --- a/includes/WatchAnalyticsParserFunctions.php +++ b/includes/WatchAnalyticsParserFunctions.php @@ -162,8 +162,7 @@ public static function renderWatchersNeeded( &$parser, $frame, $args ) { p.page_title AS page_title, p.page_namespace AS page_namespace, SUM( IF(w.wl_title IS NOT NULL, 1, 0) ) AS num_watches, - SUM( IF(w.wl_user = $wgUserId, 1, 0) ) AS wg_user_watches, - p.page_counter / SUM( IF(w.wl_title IS NOT NULL, 1, 0) ) AS view_watch_ratio + SUM( IF(w.wl_user = $wgUserId, 1, 0) ) AS wg_user_watches FROM watchlist AS w LEFT JOIN page AS p ON @@ -178,7 +177,7 @@ public static function renderWatchersNeeded( &$parser, $frame, $args ) { GROUP BY p.page_title, p.page_namespace ORDER BY - view_watch_ratio DESC + num_watches ASC ) AS tmp WHERE num_watches <= $maxWatchers